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

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

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

Post by PEB » Sat Mar 03, 2012 10:18 pm

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: 3441
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Sun Mar 04, 2012 11:45 am

Hmm, on what platforms did you test this? Does it also occur on Windows or just on OS4?

PEB
Posts: 283
Joined: Sun Feb 21, 2010 1:28 am

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

Post by PEB » Sun Mar 04, 2012 1:08 pm

I'm transfering files from OS4 to Windows 7. (Filezilla is the server on the Windows machine.)

User avatar
airsoftsoftwair
Posts: 3441
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Sun Mar 04, 2012 11:56 pm

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: 283
Joined: Sun Feb 21, 2010 1:28 am

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

Post by PEB » Mon Mar 05, 2012 1:45 am

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: 152
Joined: Fri Sep 16, 2011 9:53 am

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

Post by fingus » Fri Jul 20, 2012 9:16 am

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: 3441
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Fri Jul 20, 2012 10:38 am

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: 152
Joined: Fri Sep 16, 2011 9:53 am

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

Post by fingus » Mon Aug 20, 2012 9:34 am

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