|
|
|
<?
error_reporting(0);
$filename="adi_and_berber.gif";
$path="";
If(!IsSet($command)) $command == 0;
If($command == 0) {
?>
<HTML>
<BODY>
<BR><BR><BR><BR>
<CENTER>
<A HREF="PictureDownload.php3?command=1"><IMG SRC="<?echo"$filename";?>" BORDER="0"></A>
</CENTER>
</BODY>
</HTML>
<?
}
If($command == 1) {
header("Content-Disposition: attachment; filename=$filename");
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize("$path/$filename"));
header("Pragma: no-cache");
header("Expires: 0");
$fp=fopen("$path/$filename","r");
print fread($fp, filesize("$path/$filename"));
fclose($fp);
exit();
}
?>
View examples here :
http://new.weberdev.com/GeneralDev/examples/1562/DownloadFile.php
http://new.weberdev.com/GeneralDev/examples/1562/PictureDownload.php3 |
|
| Class that allows the PHP developer to create and manage UNIX like password files suitable for use as Apache authentication password files.
Categories : HTTP, PHP, PHP Classes, Filesystem | | | PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use! Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP | | | Open directory and File download Categories : PHP, Filesystem, Directories, HTML and PHP | | | Produces browser-safe strings while preserving HTML tags. Categories : Strings, HTTP, PHP, HTML and PHP | | | Using php3 to upload files, uploading files, file uploads. Categories : PHP, Filesystem, HTTP | | | Remote File Saving with PHP - Download and serve a remote file. The content of the file will be updated at fixed intervals. Categories : PHP, Filesystem, Cache, Sockets, HTTP | | | Remote File Size Categories : PHP, Filesystem, HTTP, Sockets | | | Upload Script, Upload File Script, Input Type="File" Categories : PHP, HTML and PHP, HTTP | | | upload function using PHP's FTP abilities. Categories : PHP, Filesystem, HTML and PHP | | | Directory TreeView - File Manager & Explorer - FTP - Utility - PHP/HTML - Categories : PHP, Directories, FTP, Filesystem, HTML and PHP | | | This script shows you the 7th latest php items from the mailing list archive on zend.com Categories : HTML, HTML and PHP, HTTP, PHP | | | Random Image Display Categories : PHP, Filesystem, Graphics, HTML and PHP | | | Easy upload class Categories : PHP Classes, Filesystem, HTTP, PHP | | | Browser Detection, Redirection Type, MSIE, MOZILLA, Netscape Navigator, NS, $HTTP_USER_AGENT, HTTP_USER_AGENT Categories : PHP, HTTP, Browsers, HTML and PHP | | | Pseudo Non Parsed Header. Output to the the browser as the script runs. Categories : PHP, HTTP, HTML and PHP | |
| | | | Kelvin Lee wrote :1356
I tried to put the script at bottom in my php script but file could not be ask for download but opened it in the browser. Why?
| |
|
|