PDA

Click to See Complete Forum and Search --> : Make a file download, instead of opening??


Smirre
Apr 4th, 2002, 02:54 AM
I have a file on my webserver.

I want this file to download when the user clicks the link, not open it in the browser window...

Can I force it to download??

/Smirre

Gimlin
Apr 4th, 2002, 06:54 AM
easiest thing to do is just zip it.

Smirre
Apr 4th, 2002, 07:01 AM
I would perfer not to zip it...

/Smirre

scoutt
Apr 4th, 2002, 09:21 PM
waht is the file extension?

if it is a known file extension on the users computer you don't have a choice. but if the file us unknown then they would be able to.

Smirre
Apr 4th, 2002, 11:36 PM
Its a PDF file. So it opens in the browser. I was thinking if there was any way to "activate" the save target as on the right click menu when the users click on the link.

/Smirre

scoutt
Apr 4th, 2002, 11:47 PM
you don't have any control over the file extension per say the user downloading it. if they have acrobat reader installed it will open it and not download it. all you can do is say on your page is "right click and save target" or right click "Save As for NS.

punkpie_uk
Apr 5th, 2002, 02:09 AM
Try getting around it...

Instead of just linking straight to a file create a new server side script, ASP or PHP would be good. Then create some code to the rename the file to a unknown ext, download it, and rename it back afterwards.

I know its a bit sloppy but it works.

veryjonny
Apr 5th, 2002, 06:30 AM
http://www.asp101.com/articles/jason/filedownloadlist/default.asp