Click to See Complete Forum and Search --> : FTP URL Syntax for file upload ??


nathan.russell
02-12-2003, 09:00 AM
I wonder if anyone can help.

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.
No problem I hear you say - just configure the FTP server to allow uploads - either anonymous or authenticated.

Ha ! - not that simple I'm afraid !
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.

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.
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.

I am doing exactly this for FTP downloads - works great - and now I need to do the same thing for uploading.

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.

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.
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)

A tall order I know - any ideas anyone ??

Any input on this would be very much appreciated.
Cheers

Nathan

nathan.russell
02-13-2003, 05:18 AM
Originally posted by Dave Clark
As supplied, the browser cannot do FTP file uploads.

Yeah, thats what I thought originally, but some (lots !!) of hunting the internet and reading around leads me to think otherwise.

I found the official RFC for URLs (RFC1738 - http://www.w3.org/Addressing/rfc1738.txt) 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).
And right near the end of that section it says:
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.
I especially like the last sentance !

So, if anyone can shed any more light on this it would be very much appreciated.
Cheers

Nathan

BriC
02-26-2010, 07:28 AM
Hi,

Re: FTP uploads via the URL.

I know it's a long time ago, but I wondered if you ever resolved this problem?
It's exactly the issue I have at the moment, so any help or insights would be greatly appreciated.

Cheers,

Brian.