I crack Photoshop!
Posts: 3
22 credits Members referred : 0
« on: Oct 05, 2007, 07:15:42 pm »
hi all, newbie here.... first, thanks Olaf for sharing this upload/download script which i am tinkering at www.alphabet-ny.com/clientLogin/page.php . the uploading part runs OK but i am lost why it can't run the download part. it will show an error message on the browser if it has an error right? but i only see a blank page and nothing is downloading. hope somebody can point me where to find solution for this. btw, i tested the scripts to a different server and uploading/downloading files were OK.
thanks in advance!
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
if (isset($download)) { $fullPath = $folder.$_POST['file_in_folder'];
if ($fd = fopen ($fullPath, "r")) { $fsize = filesize($fullPath); $path_parts = pathinfo($fullPath); $ext = strtolower($path_parts["extension"]); switch ($ext) { case "jpg": header("Content-type: image/jpg"); header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use "attachment;" for forcing download rather than just viewing on page - as jpgs and gifs will be displayed if attachment isn't indicated. break; case "zip": header("Content-type: application/zip"); header("Content-Disposition: filename=\"".$path_parts["basename"]."\""); break; case "pdf": header("Content-type: application/pdf"); header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); break;