Local $sFile = @ScriptDir & "index.html"
Local $nFileReadSize = FileGetSize($sFile)
Local $hFile = FileOpen($sFile)
Local $nFileBinarySize = BinaryLen( FileRead($hFile) )
FileClose($hFile)
The results are:
$nFileReadSize == 630
$nFileBinarySize == 622
I'm using this to send large files in chunks, and I cannot load the whole file in to a string with FileRead() due to memory limitations. I'm also sending it via the web using http. So, I must get the actual BinaryLen() for the http header somehow, without loading the whole file. I'm stumped.
My current method has been to load the file in chunks at the initialization stage, calculate each step, and just save the number for any file greater than the memory threshhold. Obviously this will scale badly!
Any ideas? Thanks!