|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
script wrappers and php file downloads
Okay, here's the deal, I've scoured the web and nobody can provide an answer that works! I want users to be able to download a PHP file from my site. It runs through a wrapper, so people can't see the path, ie
mysite.com/download.php?var=file.php Here's the best I've found. --start snippet-- OK. I'm halfway there. I'm using the following wrapper: header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=$filename"); This works fine in Netscape with the correct filename showing up. MSIE pops up the window with the filename of the wrapper instead of the $var variable. Any other way to "force" the filename or at least another way to do it that will work in MSIE? I think MSIE is the one where you add $var to the end of the URL, no matter how goofy it looks, to convince it what to name it. I think there's also a Microsoft non-standard header for the name of the file, but I always forget what it is... It's in the mailing list archives. EG: http://vectox.com/download.php/filename.zip?var=filename.zip That middle filename.zip is, of course, totally bogus as a pathname and not used by PHP at all, but MSIE sees it at the end of the "path" and says, "Oh, this file should be named filename.zip". --end snippet -- So I built a browser detect that writes the path EXACTLY as it has above, but guess what? It don't be to work! I have tried a lot of methods but IE still calls the file "download" as in download.php, the name of the wrapper. Help is MUCH appreciated, alternate solutions also kindly accepted! |
|
#2
|
|||
|
|||
|
RE: script wrappers and php file downloads
Here's a link to a script posted on the forums at phpbuilder...check it out and let me know if it works...
http://www.phpbuilder.com/forum/rea...4&thread=135500 |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > script wrappers and php file downloads |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|