FTP Transfer speed issue {FIXED}

Just starting out? Need help? Post your questions and find answers here.
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Re: FTP Transfer speed issue

Post by TerryHough »

kinglestat wrote:there where a couple of bugs in the code...no big deal
Bugs are a big deal to me, so do tell what you found. I created this example by stripping down a more extensive piece and well used program, so there could still be some issues that crept in while creating a working example for you.

Comparing between a FTP program created with the current PB FTP Library and Filezilla is likely to show very different speeds. PB is a rigidly defined setup. Filezilla is substantially more flexible with transmission type, buffer size, etc. and may even do some optimization based on the accessed server connection. PB's FTP commands don't allow that flexibility and have no way (that I am aware of) to interrogate the server.

That being understood, you can accomplish the singular task of sending a file to an FTP server quickly and reliably. Speed can be optimized for a particular server by studying the server's response(s) and tweaking the PB code to accomodate the server's idiosyncracies. To do that with PB's limited FTP command set is pretty difficult. If you want more control, search for the "FTP Library" created by Num3 and expanded by myself and others back about 5 years ago.
There are examples there that show the "FTP conversation" between the progam and the server. I believe I last updated my examples for PB Vs 4.51 in 2011.

Good luck! :D
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: FTP Transfer speed issue

Post by Paul »

There is also the FTP User Lib you can try if you want something really easy to use.
http://www.reelmedia.org/cgi-bin/PurePr ... &sub=ASM46
Image Image
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Re: FTP Transfer speed issue

Post by kinglestat »

@terry

the 2 bugs were;

Calling FindLocalSize() before gadgets being initialized
and the part where you change dir on ftp server, it seems you assume you always have a path...which is not the case with me

Believe me if my bugs were that easy!

Anyway it was your code which fixed my bug...I think the issue was I was adding a path to the upload file

eg /dir/nested/file.bin rather than cd-ing as your code does.

So thanks all for your help

Re using other ftp...I have other sources but this particular app needs to be ported to linux and mac...hence the use of only purebasic

cheers
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Re: FTP Transfer speed issue

Post by TerryHough »

@kinglestat
kinglestat wrote:Calling FindLocalSize() before gadgets being initialized
Actually, the "AddGadgetItem(1,-1, "")" in that procedure doesn't pass the Debugger's check and stops the compile since the gadget has not yet been initialized, but only if you have the Debugger turned ON. Otherwise it compiles and runs fine. I almost never use the Debugger, so I had not noticed it. The Debugger argues with my style of coding too frequently.
kinglestat wrote:the part where you change dir on ftp server, it seems you assume you always have a path
You are correct. The ServerDirectory$ may be empty and frequently is in my usage. But it cannot be just a "\" or "/". I will correct that.
kinglestat wrote:I think the issue was I was adding a path to the upload file. eg /dir/nested/file.bin rather than cd-ing as your code does.
I believe you are correct. I tested that against my Linux based server and it accepted the file reasonably quickly, but then the file wasn't accessible because the server stored the file with the name "/dir/nested/file.bin". Then, of course, the file also could not be deleted.

When I tried my Windows based server, it did not return an acceptance code which just left the PB command waiting for the response. :)

Glad you are going now and I'm pleased my code helped you solve your issue.

Terry
Post Reply