Interesting Problem with UploadFile()---and a workaround

Report any Hollywood bugs here
Post Reply
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Interesting Problem with UploadFile()---and a workaround

Post 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.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Interesting Problem with UploadFile()---and a workaround

Post by airsoftsoftwair »

Hmm, on what platforms did you test this? Does it also occur on Windows or just on OS4?
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Interesting Problem with UploadFile()---and a workaround

Post by PEB »

I'm transfering files from OS4 to Windows 7. (Filezilla is the server on the Windows machine.)
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Interesting Problem with UploadFile()---and a workaround

Post 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?
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Interesting Problem with UploadFile()---and a workaround

Post 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.
User avatar
fingus
Posts: 269
Joined: Fri Sep 16, 2011 9:53 am

Re: Interesting Problem with UploadFile()---and a workaround

Post 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! :-)
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Interesting Problem with UploadFile()---and a workaround

Post 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.
User avatar
fingus
Posts: 269
Joined: Fri Sep 16, 2011 9:53 am

Re: Interesting Problem with UploadFile()---and a workaround

Post 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.
Post Reply