Sign in to follow this  
Followers 0
Synapse

_FTP_ProgressUpload blocks app with bigger files

6 posts in this topic

Hello...I wanted to ask if anyone had this problem before using _FTP_ProgressUpload. I have a script that update or download files from a private FTP server and when I try to upload or download files bigger then 10MB i noticed a huge script freeze (I can't move the window, can't cancel the process...almoust nothing until it's finished).

Is there a workaround or a trick to not make it freeze while it's uploading? Or is there another way to get the progress to upload/download files from FTP.

PS. I tryed using curl and read the STDOUT but I can't get a continuous stream of info from stdout to process the progress..

This is the function I call to show the progress...If i leave the call progress function empty it's still the same

Func _UpdateProgress($percent)
      GUICtrlSetData($Progress, $percent)
      GUICtrlSetData($ProgressLabel, $percent &" %")
      Switch GUIGetMsg()
        Case $ButtonCancel
           Return 0 ; Just Cancel
      EndSwitch
      Return 1 ; Otherwise contine Upload
Endfunc

Share this post


Link to post
Share on other sites



Might be interesting to look at the part size and # of parts that the UDF is breaking the transfer into... If you open FTPEx.au3 and add this line for debugging:

MsgBox(0,"PartSize/Parts",$x&"/"&$parts)
on line 1219, then try calling the function...what does it say?

Share this post


Link to post
Share on other sites

Might be interesting to look at the part size and # of parts that the UDF is breaking the transfer into... If you open FTPEx.au3 and add this line for debugging:

MsgBox(0,"PartSize/Parts",$x&"/"&$parts)
on line 1219, then try calling the function...what does it say?

The MsgBox returned: 323917/101

Share this post


Link to post
Share on other sites

That's a decent sized chunk... There are similar issues reported with larger files for FTP:

http://www.autoitscript.com/forum/index.php?showtopic=113542

http://www.autoitscript.com/forum/index.php?showtopic=111480

In the 2nd post, jchd posts a modified function that uses smaller chunk sizes, which may be part of the problem depending on the environment...

My only other advice would be trying to debug a little bit where the 'freeze' is happening. Using msgbox or console writes for example. If the latency is coming from the DLLCall()s, there isn't much we can do about it... Decreasing the chunk size or maybe looking a a co-processes or multi-thread like UDF to make the calls non-blocking to your GUI.

Share this post


Link to post
Share on other sites

Assuming it is the DLLCall for InternetWriteFile that blocks'(although that remains to be proven I'm highly suspicious), there is an interesting discussion here: http://www.mombu.com/microsoft/win32-programmer-networks/t-internetwritefile-performance-question-265835.html where they seem to recommend keeping the chunk sizes below or near the 64k mark. Which for the context of this UDF, would start to manifest itself in files > than about 6MB.

Share this post


Link to post
Share on other sites

Thx for the reply..i've already tryed out those methods in the thread u've pointed out...but with no luck...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0