0

How can i force content-disposition dir? it get the file from temp dir... i would like to change thi dir...

header("Content-type: application/zip");
header('Content-Disposition: attachment; filename="' .$file_zip. '"');
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
Omega
  • 8,640
  • 9
  • 30
  • 29

1 Answers1

2

The filename attribute is supposed to hold only the filename, not the entire file path. Get rid of that path. It's up to the enduser (and its webbrowser configuration) where to save the file. There is no way to control the save location from the server side on.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 3
    Then the posted code is completely irrelevant to the *actual* problem (sorry, your English was pretty terrible so I had to guess based on the code). All those headers do is just instructing the client what content type the response body is in and that it has to show a *Save As* dialogue with the proposed default filename. You need to post some code wherein you're actually reading the file. E.g. [`readfile()`](http://php.net/manual/en/function.readfile.php) or so. Then we can suggest how to fix it accordingly. – BalusC Nov 12 '10 at 12:34