Ik heb de volgende headers om een bestand te downloaden, maar als ik op Opslaan Als... druk en het bestand opsla, dan kan ik in mijn IE wel linkjes aanklikken, maar IE gaat er niet heen (heb nog steeds dezelfde pagina). Wat doe ik fout?
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| // Hack for IE-bug if( strstr( $HTTP_USER_AGENT, "MSIE" ) ) { $sAttachment = ""; } else { $sAttachment = " attachment;"; } // Determine size and open file for reading $iFileSize = filesize( $sFile ); $rFile = fopen( $sFile, "r" ); // Send headers to the client header( "Content-Type: application/x-ms-download" ); header( "Content-Length: $iFileSize" ); header( "Content-Disposition:$sAttachment filename=$sFileName" ); header( "Content-Transfer-Encoding: binary" ); // Send and auto-close the file fpassthru( $rFile ); |
[ Voor 8% gewijzigd door Verwijderd op 25-11-2002 10:16 ]