Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Open Source Projects
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Open Source Projects The place to discuss Basic4ppc open source applications.


Low-level FTP upload with progress


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-10-2008, 05:32 AM
brathbone's Avatar
Junior Member
 
Join Date: Feb 2008
Location: Rutherfordton, North Carolina
Posts: 25
Send a message via MSN to brathbone
Default Low-level FTP upload with progress

Greetings to the Basic4PPC community,

This is my first post, and I would like to thank all of you for the work you've done. Basic4PPC is a fine product. Helpful posts in the forum, and open-source projects made my transition to Basic4PPC a breeze.

I needed to prototype a FTP-based application and was up and running quickly, but I really needed to show progress during FTP uploads. After searching the forum and seeing that the built-in FTP methods are synchronous, which makes perfect sense for simplicity's sake, I decided to port my FTP socket code from REALbasic to Basic4PPC and make it open-source.

Though the project currently only does uploads, I will be working on downloads in the near future.

I've tested with Windows and UNIX FTP servers, and so far all is well. There is certainly a good amount of work left to be done, but this should be a really good start.

What this project does:

Provides PASV mode binary FTP file uploads with progress.

Uses network.client.DataAvailable to provide a mostly complete, client-side FTP implementation.

Passive (PASV) mode port is used for firewall friendliness. For those of you not familiar with PASV vs. PORT mode I will provide a brief explanation. FTP uses two connections: a command socket and a data socket. The command socket connects outbound from the client on port 21 to the server, which is listening for connections on port 21. In Active (PORT) mode, the server would connect the data socket back to the client, which would have to be listening for this connection. Many firewalls support this, but there can be problems. In PASV mode, the server listens on a new random port and sends that random port to the client via the command socket. The client then connects the data socket outbound on the dynamic port, thus all connections from the client are outbound and most client-side firewall issues should be averted.

Any comments, bug reports and/or contributions will be welcome and appreciated. I hope some of you find this useful.

Best wishes,
Attached Files
File Type: zip ftp_progress_v1.zip (50.2 KB, 310 views)
__________________
Brian Rathbone

Author of The Dawning of Power fantasy trilogy. Get the eBook for only $7.99

Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
Reply With Quote
  #2 (permalink)  
Old 02-10-2008, 06:49 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 4,533
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Thank you for sharing this valuable code.
I'm sure happy that an FTP expert has joined our community
Reply With Quote
  #3 (permalink)  
Old 02-10-2008, 06:54 AM
brathbone's Avatar
Junior Member
 
Join Date: Feb 2008
Location: Rutherfordton, North Carolina
Posts: 25
Send a message via MSN to brathbone
Default

Thanks Erel. I'm darn glad to be here and look forward to doing some cool things.

__________________
Brian Rathbone

Author of The Dawning of Power fantasy trilogy. Get the eBook for only $7.99

Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
Reply With Quote
  #4 (permalink)  
Old 02-10-2008, 11:42 AM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 180
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Thumbs up

good job
__________________
Gianni Maione
Reply With Quote
  #5 (permalink)  
Old 06-07-2009, 05:27 AM
Newbie
 
Join Date: Apr 2009
Posts: 1
Default FTP upload not working with WM5

Hi and thanks for this code!

It works with WM5 but not with WM4. Unfortunately we have hundreds of ppcs and I have to get some backward compatibility.

The problem I get is that the file is uploaded but when you close the connection the transmission does not complete properly somehow the file gets deleted at the server side.

Has anyone had any experience with this ?
Thanks

George Mu'ammar

Last edited by geo-rge : 06-07-2009 at 05:45 AM.
Reply With Quote
  #6 (permalink)  
Old 09-26-2009, 06:59 AM
Senior Member
 
Join Date: Apr 2009
Posts: 103
Default

Excellent code.
Thanks very much for this. Very instructive
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload text file aerohost Questions & Help Needed 2 06-17-2008 05:37 PM
Outlook set sensitivity level Rallig Questions & Help Needed 5 05-17-2008 02:28 PM
Can I upload and download files from device to PC superbabicka Questions & Help Needed 2 03-31-2008 02:47 PM
HTTP upload sample bluedude Questions & Help Needed 2 12-28-2007 08:59 PM
Low-level memory functions Mistrel Basic4ppc Wishlist 3 10-19-2007 06:57 PM


All times are GMT. The time now is 08:06 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0