Page 1 of 1
Interesting Problem with UploadFile()---and a workaround
Posted: Sat Mar 03, 2012 10:18 pm
by PEB
Using UploadFile() to transfer large files (>20 MB) to a local FTP server always fails unless I add a tiny delay.
As a workaround, I specify a callback function for UploadFile() and add an extremely small delay (1 millisecond) in this function; then it transfers the large files without error.
Code: Select all
Function p_TransferCallback(msg)
Wait(1, #MILLISECONDS)
If msg.action=#UPLOADFILE_STATUS Then DebugPrint(msg.count.." of "..msg.total)
EndFunction
I have a hard time believing that 1 millisecond would make such a difference; however, every test without the delay has failed, and every test with the delay has worked.
Re: Interesting Problem with UploadFile()---and a workaround
Posted: Sun Mar 04, 2012 11:45 am
by airsoftsoftwair
Hmm, on what platforms did you test this? Does it also occur on Windows or just on OS4?
Re: Interesting Problem with UploadFile()---and a workaround
Posted: Sun Mar 04, 2012 1:08 pm
by PEB
I'm transfering files from OS4 to Windows 7. (Filezilla is the server on the Windows machine.)
Re: Interesting Problem with UploadFile()---and a workaround
Posted: Sun Mar 04, 2012 11:56 pm
by airsoftsoftwair
Hmm, that's of course a very special setup. It could also be a problem with OS4's network implementation. Do you have the chance to test the transfer on a non-OS4 machine?
Re: Interesting Problem with UploadFile()---and a workaround
Posted: Mon Mar 05, 2012 1:45 am
by PEB
I just tested a Win32 executable with the same code, and the problem did NOT show up. So I guess it is something with OS4.
Re: Interesting Problem with UploadFile()---and a workaround
Posted: Fri Jul 20, 2012 9:16 am
by fingus
I experience also a bug with uploadfile, i have uploaded a 2 MB File, but Uploadfile don“t stop uploading at fileend and upload further and the File (test.exe) on the FTP-Server grows bigger and bigger. In fact i recognize it when he wrote 20MB on the FTP while wondering that this take so long. Maybe you fix here can solve my problem too!

Re: Interesting Problem with UploadFile()---and a workaround
Posted: Fri Jul 20, 2012 10:38 am
by airsoftsoftwair
If the error can be reproduced every time, please provide some sample code and then I can have a look. There are dozens of different FTP server implementations and Hollywood might have a problem with some. In order to fix this, I need sample code that contains the URL of an FTP server that doesn't work.
Re: Interesting Problem with UploadFile()---and a workaround
Posted: Mon Aug 20, 2012 9:34 am
by fingus
Andreas wrote:If the error can be reproduced every time, please provide some sample code and then I can have a look. There are dozens of different FTP server implementations and Hollywood might have a problem with some. In order to fix this, I need sample code that contains the URL of an FTP server that doesn't work.
I will provide you with a working example in the next time, maybe this problem is in common with transfermode active/passive.