|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
generate file
Hi,
I have some data in $data. I want that when you go to export.php, $data in extracted into a file : extract.tab . I first tried this: header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=extraction.tab"); header("Pragma: no-cache"); header("Expires: 0"); print $data; It works fine with MOZILLA. But Internet Explorer is trying to make me download export.php instead of the extraction file ! So I tried this : header('Content-Type: application/octet-stream'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); if (PMA_USR_BROWSER_AGENT == 'IE') { header("Content-Disposition: inline; filename='extraction.tab'"); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { header("Content-Disposition: attachment; filename='extraction.tab'"); header('Pragma: no-cache'); } but the problem remains the same ... What should I do? Thank you, Nathan |
|
#2
|
|||
|
|||
|
RE: generate file
check out the user comments on the php manual page for the function header()
one of those things should work.. |
|
#3
|
|||
|
|||
|
RE: generate file
I already checked. Didn't find anything that helped me...
|
|
#4
|
|||
|
|||
|
RE: generate file
|
|
#5
|
|||
|
|||
|
RE: generate file
extraction.tab is not a file pre-existing.
all the data is in $data, so I cannot filesize it, or readfile it. |
|
#6
|
|||
|
|||
|
RE: generate file
Hey thanks,
I adapted your script to my problem, and it works ! $filename = "mmhorders-".$fromM."-".$fromD."-".$fromY."-".$toM."-".$toD."-".$toY.".tab"; header("Content-Type: application/force-download"); header('Accept-Ranges: bytes'); header('Connection: close'); header("Content-Disposition: attachment; filename=$filename "); print $data; Thank you, Nathan |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > generate file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|