Forum Moderators: phranque

Message Too Old, No Replies

Page that looks like an FTP page

Allowing users to download by clicking

         

salewit

5:08 am on Oct 22, 2008 (gmt 0)

10+ Year Member



I've got a customer that is looking to put files in a folder for her customers to be able to go to the folder and download any of these files by simply clicking on them (no right click). I think it should have an FTP *look*, but the customer would just use their browser, and instead of clicking a file and it opening, it goes straight to a download prompt.

So...

1) Customers don't need to know or have to use FTP
2) Regardless of file type (image, txt, exe) clicking on filename goes direct to download
3) Person adding/maintaining the files simply has to add files to the folder and they'll show up on the list. Perhaps they'd run some kind of "regenerate" script.

Anyone know of anything like this or any suggestions?

JS_Harris

5:33 am on Oct 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'll need an upload script for others to add files without ftp.

To download them however, any zipped file instantly triggers the download box - nothing special needed.

phranque

7:18 am on Oct 22, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you can't really force browser behavior for clicking on a link, but you can usually get this to work correctly if you include the Content-Disposition: HTTP Response header after the Content-Type: header:
Content-Type: mime/type
Content-Disposition: attachment; filename="file.name"

(then your content starts here...)