Today to write the project encountered a bug, write download image function Click Download is not read the picture, the path also tried a lot of methods are wrong, feeling very depressed. Finally put my classmate's code admitted or can not use, I was thinking in his that how can use? How can I not, depressed for nearly 30 minutes finally he said the header can not have data it, then I suddenly enlightened is ah, should be emptied, immediately out of breath, so small problem delayed nearly a lesson, so I want to share it to everyone do not make such a mistake again
The code is as follows:
/upload Path
[HTML]
$filename =$_get["Photo"];
Clear the above information
Ob_clean ();
Header ("Content-type:image/pjpeg");
Header ("Content-disposition:attachment;filename=". $filename);
Header ("Content-length:". FileSize ($filename));
ReadFile ($filename);
Excerpt from Siwena's column
http://www.bkjia.com/PHPjc/478283.html www.bkjia.com true http://www.bkjia.com/PHPjc/478283.html techarticle //write a project today encountered a bug, write download image function Click Download is not read the picture, the path also tried a lot of methods are wrong, feeling very depressed. Finally put my classmate's generation ...