Last resort

They have: 5,633 posts

Joined: Jan 1970

I have come back. I know you all missed me but I need help and cant find it anywhere.
I want people to go to a .aspx page with a querystring then if the string is valid then download a zip file that is not in the webroot folder.
I have sucessfully been able to copy the content from the zip file to the asp page. And set the content-type to "application/x-zip-compressed". The browser tries to download it as a zip file but it still has the ".aspx" extention.
IE downloads with a .zip extention no proublem (IE is pro virus) I need to tell all browsers to download as a .zip. Any suggestions?

demonhale's picture

He has: 3,278 posts

Joined: May 2005

Why not put an html redirect instead with the actual auto load link on the html page is the zip, so that it downloads as a zip... (a double redirect done by some other download sites)

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

I'm not sure if this will work or not, and as this is for .php and apache, not sure if you can find something similar for asp adn IIS.

From what I came across, if you put the following into a .htaccess file for a directory just for your script:

Quote: AddType application/x-httpd-php .html .php .htm .zip

then for that directory, any file in a .zip extention will get processed as a php file. So then you could still have a script to get the actual file from another location as you already did, but give it a .zip extention. Then the downloaded file should addapt the .zip extention from your script.

-Greg

They have: 5,633 posts

Joined: Jan 1970

Well I tried creating a dummy.zip file and rewriteing the contents but I got some permissions error. Since I pay someone to host then I dident mess with it any further.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.