Jump to content

aahh

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aahh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [code]header("HTTP/1.1 200 OK"); etc.[/code] Yes, I saw that also but I tried it with no effect. IE just kind of hangs around on the "Getting File Information" dialog for a few seconds then gives up.
  2. Yes, tried with and without quotes, with and without semicolon and every other combination.  There's some other bug, maybe not in the code, which I need to identify and work around.
  3. [quote]wait... where does that semicolon after filename comes from??[/quote] Just one more variation that was tried. It makes no difference -- quotes, semicolons -- all work with FF, none work with IE (on my server). IE never even sees the filename. I'm forced to the only logical conclusion: Gremlins.
  4. Even as an mp3 file and without forced download it does the same thing. Frankly, I just don't think IE is even getting the headers. Something is going wrong before that. The error message says it cannot download "script-name", not "filename". Here's the current code: [code]<?php $dir = dirname(__FILE__); chdir($dir); $file="testfile.mp3";  $filesize = filesize($file); $filename = trim(basename($file)); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Vary: Accept-Encoding"); //header("Content-Type: application/force-download"); header("Content-Type: application/*"); header("Content-Disposition: attachment; filename=\"$filename\";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".$filesize); @readfile($file); exit; ?>[/code]
  5. [quote]You dont need to force a zip download ok[/quote] I think I do. My application (when it eventually downloads) will be feeding out MP3 files via email links. I don't want the MP3 to open in the browser, thus the forced download. Interestingly, if I name my script "downloadtest.php" and put it in an href linke like: [code] <a href="http://mydomain/downloadtest.php">Download test</a>[/code] It works when clicked. However, if I paste the url  [tt]http://mydomain/downloadtest.php[/tt] directly in the browser window it fails. Links opened from other applications (such as links opened from Outlook) naturally fail. Any ideas?
  6. [quote author=legohead6 link=topic=101298.msg400717#msg400717 date=1153426036] Maybe that servers screwed up..is it possible to try on a third? Cuz if it works on one then i dont think it would be a coding error! [/quote] There is no error in the code. It's some kind of freaky server setting which I need to either change or find a workaround. The question is, what kind of a setting could produce such an error?  I'm a loss as to where to look.
  7. [quote]try these settings in apache[/quote] Thanks but no effect.
  8. [b]Summary: File download script works in FF but not IE. On an alternate server it works fine with IE.[/b] Lots of people seem to have this problem but mine does not seem to resolve by changing headers: It works perfectly in FireFox, not at all in IE, I get the Error: [quote]Internet Explorer cannot download (script name) from (site) Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.[/quote] [i]This has nothing to do with PDF or SSL[/i]. I've tried every conceivable code combination, here's the latest stab: [code]<?php $dir = dirname(__FILE__); chdir($dir); $file="testfile.zip";  $filesize = filesize($file); $filename = trim(basename($file)); ini_set('zlib.output_compression', 'Off'); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Vary: Accept-Encoding"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=$filename;"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".$filesize); @readfile($file); exit; ?> [/code] To complicate things, this code works perfectly well with IE on another server. Both servers are running PHP 4.4.2 and Apache (1.3.36 (Unix) works, 2.0.46 (Red Hat) fails) I tried a header sniffer (http://web-sniffer.net) but it fetches all headers correctly from both servers. Both look essentially identical. Also, notice that the error message (and the IE dialog) refer to the download [i]by the script name, not the supplied filename[/i]. [b]I don't think IE is even getting the headers![/b] I tried using flush() after the headers (before "readfile()") but to no effect. What kind of configuration issue might be causing this?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.