|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Force Download with the default filename of the actual file
Hi, currently i have a system set which forces people (on most browsers) to save the pdf document in question to disk. When this document saves the default save name is the name of the script rather then the name of the pdf document. Is there a way for me to make the default save name the actual name of the pdf document? here is my code...
@$fileName = "27xSdox/$filedata.pdf"; @$filesize = filesize($fileName); if($filesize) { @Header("Content-Length: ".$filesize); @Header("Content-Disposition: attachment; filename=".$fileName); @readfile($fileName); } thanks |
|
#2
|
|||
|
|||
|
RE: Force Download with the default filename of the actual file
I thought that browsers take the title as a savename.
I'm not sure... |
|
#3
|
|||
|
|||
|
RE: Force Download with the default filename of the actual file
Here's a thread at phpbuilder that might be of some help. Different browsers download differently, and this script takes that into account...
http://www.phpbuilder.com/forum/rea...4&thread=135500 |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Force Download with the default filename of the actual file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|