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