when i download a file from uploaded files and when i open it it is not opening correctly..image or data in text file is not dispalying
I follow all steps mentioned in the link given below to upload file add file,list file and get file...All things are going fine..But i have one problem When i download the file(it is downloaded no problem) but when i open it then file is not opening..Like suppose i have downloaded an image then after download if i try to open it erro is photogallry can not open this,may be file format is not supported..I am using window vista..So plz tell me where i开发者_高级运维 am falling wrong...I alos passes headed in get file so that my browser can know what type file is this..In following link i used mysql rather than mysql ietc.
Headers passed are..
header("Content-Type: ". $row['mime']);
header("Content-Length: ". $row['size']);
header("Content-Disposition: attachment; filename=". $row['name']);
The link for tutorial is
http://bytes.com/topic/php/insights/740327-uploading-files-into-mysql-database-using-php/2#post3541329
Now tell me please what is this problem and how i can download file without any error..I also without using headers but then only temporaray name is displaying beacus in data variable i am storing temproary name
Make sure the length is set correctly. You probably don't need the header("Content-length: ...");
part. Here is an example of how to download a file with PHP: PHP outputting file attachments with headers
精彩评论