neslo mi to ... nasiel som na nete ako to ma byt a ako to chcem!!!!!:
subor slideshow.php:
<a href="stiahnut.php?obrazok=
<?php echo $_REQUEST['obrazok']."&typ=".$_REQUEST['typ'];?>">stiahnuť obrázok</a>
subor stiahnut.php
<?
/*/
Download a file using fpassthru()
/*/
$fileDir = ""; // supply a path name.
$fileName = $_REQUEST['obrazok']. $_REQUEST['typ']; // supply a file name.
$fileString=$fileDir.''.$fileName; // combine the path and file
// translate file name properly for Internet Explorer.
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")){
$fileName = preg_replace('/\./', '%2e', $fileName, substr_count($fileName, '.') - 1);
}
// make sure the file exists before sending headers
if(!$fdl=@fopen($fileString,'r')){
die("Cannot Open File!");
} else {
header("Cache-Control: ");// leave blank to avoid IE errors
header("Pragma: ");// leave blank to avoid IE errors
header("Content-type: application/jpg");
header("Content-Disposition: attachment; filename=\"".$fileName."\"");
header("Content-length:".(string)(filesize($fileString)));
sleep(1);
fpassthru($fdl);
}
?>
.. je to prisposobene podla mojej potreby lebo predavam premenne .. takze ak to budes skusat treba aby si si dakde na zaciatku slideshow.php nadefinoval $obrazok="DSC01810"; $typ=".JPG"
PS: otestovane a funguje vo FF 2, IE 6 aj Opere 9
|