FTP URL Syntax for file upload ??

liunx

Guest
I wonder if anyone can help.<br />
<br />
I am currently writing a web application. I have both a HTTP server and an FTP server up and running; and I need my website users to be able to upload files to my FTP server.<br />
No problem I hear you say - just configure the FTP server to allow uploads - either anonymous or authenticated.<br />
<br />
Ha ! - not that simple I'm afraid !<br />
I want this app to be really neat and dead simple for my users to use. Along with the file upload, via an HTML form I need to capture their name, a description of the file, who it is destined for etc.<br />
<br />
The action of the form should store these details in a database (no problem, I have that part in place and working), and then 'kick off' the FTP upload.<br />
My form can easily capture the local filename of the file to upload with an <input type="file"> tag - so the back end processor that receives this form knows the uploaders name, file description etc, and the filename. It then writes its record into the database, returns a HTML page saying "Thanks for the upload ...", and spawns a new browser window whose URL is the FTP upload.<br />
<br />
I am doing exactly this for FTP Download <!--more-->s - works great - and now I need to do the same thing for uploading.<br />
<br />
Now, there are some 'givens' in this - some things I cannot change. The main one is that I have to use FTP for file transfers. We are talking about very large file transfers and HTTP is not up to the job of it - so that counts out using ENCTYPE="multipart/form-data" on the <form tag.<br />
<br />
Also, I need this to be a really neat solution - so I dont want to spawn the new browser window that simply logs the user into the FTP server so that they can drag and drop into it.<br />
I want to do it all from the one form - you know, the idea of one click file uploads (exactly like you would get with ENCTYPE="multipart/form-data" on the <form tag - but using FTP not HTTP)<br />
<br />
A tall order I know - any ideas anyone ??<br />
<br />
Any input on this would be very much appreciated.<br />
Cheers<br />
<br />
Nathan<!--content-->Originally posted by Dave Clark <br />
As supplied, the browser cannot do FTP file uploads. <br />
<br />
Yeah, thats what I thought originally, but some (lots !!) of hunting the internet and reading around leads me to think otherwise.<br />
<br />
I found the official RFC for URLs (RFC1738 - <!-- m --><a class="postlink" href="http://www.w3.org/Addressing/rfc1738.txt">http://www.w3.org/Addressing/rfc1738.txt</a><!-- m -->) which goes into great detail about how URLs are composed and what each component does - and there is a whole section on FTP URLs (section 3.2).<br />
And right near the end of that section it says:<br />
FTP URLs may also be used for other operations; for example, it is possible to update a file on a remote file server, or infer information about it from the directory listings. The mechanism for doing so is not spelled out here.<br />
I especially like the last sentance !<br />
<br />
So, if anyone can shed any more light on this it would be very much appreciated.<br />
Cheers<br />
<br />
Nathan<!--content-->
 
Back
Top