i am using the following code
<?php
$rFile = $_GET['sfile'];
$rExt = $_GET['ext'];
header("Content-disposition: attachment; filename=".urlencode( $_GET['sfile'] ).".".$_GET['ext']);
header('Content-type: Image/jpeg');
readfile( "wallpapers/".$rFILE.$rRes.$rExt );
?>
i pass the variables and the files are being downloaded.. but the images are not being created ..
- i see a image file with image icon with correct name but theres no preview
- the images are not opened in any image viewer (all the images i use are JPEGs)
- all the downloaded images have same size 336 to 337 bytes… so i thought maybe transfer size is limited and so i use Similar SO Question but after that only the file size grew to 445bytes to 446bytes nothing more…
WHAT TO DO.. i need to provide direct links for image download…
I’ll bet a beer that the 336 to 337 bytes contain a PHP error message that will tell you what the problem is.
Remove the JPEG content-type header to see the output.