But you can't normally upload to an http connection through a basic [url]ftp://domain.com/[/url] connection... just download.
What I'm doing right now is:
user logs in. If an FTP connection is established, login successful, then a file listing is presented through listDirectory(); (I made this), each item wrapped in a ?download=filename url. the users name/password is stored in the session.
When the user clicks on one, I send an ftp_get() with that filename, and it downloads into a temp directory (which is web accessible)
upon which I fire a header("Location: http://path/to/temp/".$filename);
this should download the file to the user.
As for upload, I have a file uploader for, your basic stuff, which uploads the file to the temp folder, then ftp_put() sends it up to the server.
Hopefully in the right spot.
Once done, the listDirectory() is run and the newly updated file should be presented.
Is this just silly or what?
One problem: if the file is a typical jpg or gif or something the browser recognizes, rather that downloading it, the browser show renders it to the screen.
How can you force an image file to download to a user?
you can't eh?
You'd have to zip or tar the file or something...?