This is a discussion on Image downloading within the PHP Programming forums, part of the Web Development category; Hi, I would like to download a jpg image using php. The image resides in the same folder where the ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Try the below codes for downloading the image. <? $img = "image.jpg"; $fileSize = filesize($img); header('Content-Length: '.$fileSize); header('Content-type: image/jpeg'); header('Content-Disposition: attachment; filename="'.$img.'"'); header('Content-Transfer-Encoding: binary'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); readfile($img); ?> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DPI of an Image | Anandavinayagam | C# Programming | 6 | 12-12-2008 05:53 AM |
| Convert image to other image format using CODEC in .NET 3.0 | Mramesh | C# Programming | 0 | 02-07-2008 03:33 AM |
| How to create an image from panel background Image | S.Vinothkumar | C# Programming | 1 | 10-22-2007 03:52 AM |
| Rotating an Image | muthukumar | HTML, CSS and Javascript Coding Techniques | 1 | 07-30-2007 03:18 AM |
| Problem in downloading multiple files as an archive. | sureshbabu | PHP Programming | 0 | 07-20-2007 06:16 AM |