|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
MYSQL blob file download IE problem
Hi
I wondered if anyone had played around setting up a MYSQL database with blob fields for saving binary files. I have done this myself, using a PHP web interface to upload/download. the only problem i have occurs when downloading on a windows machine using Internet Explorer. When the usual download dialog box pops up prompting the user to OPEN or SAVE the file, if the user clicks OPEN, the file is downloaded (to a temporary destination) and then subsequently "lost". ie the appropriate application would open and then report that the file was "not found" or similar. in contrast, if the user chooses SAVE then the file downloads without any problems. i also do not get this problem in any other browsers, eg mozilla, safari. i am using the following headers to output: header("Content-Disposition:attachment; filename=\"$filename\""); header("Content-length: $size"); header("Content-type: $type"); any ideas would be greatly appreciated cheers rich ![]() |
|
#2
|
|||
|
|||
|
Hi, I can remember that I had the same problem some time ago with online generated PDF-documents. Not sure what caused it though.
Anyhow, this works for me: // Output the correct headers to force the 'download' option header("Content-Type: application/pdf"); // seems to work for IE and NS header("Content-Disposition: attachment; filename=document.pdf"); header("Content-Length: ".filesize($file)); header("Accept-Ranges: bytes"); header("Pragma: no-cache"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-transfer-encoding: binary"); |
|
#3
|
|||
|
|||
|
amazing
yep, that worked
i wonder what causes it? probably inferior programming on microsoft's part as usual. thanks a lot, life saver! rich |
|
#4
|
|||
|
|||
|
Well ... one thing what differs are the extra quotes in your first header line. Maybe its just that.
The other headers are good to have to disable caching. The last header is almost always needed to force binary mode in stead of text. Anyway, glad to be of help (H) |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > MYSQL blob file download IE problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|