Php uploads PDF files. some special characters are lost. php uploads PDF files. uploaded to the server. some special characters in the PDF file are not displayed. After compressing the PDF file into a zip file, the system prompts that the compressed file is damaged.
Answers from experts
Reply to discussion (solution)
Php does not destroy the file content when uploading files. This can be seen from the original display of the uploaded image.
Of course, if you have processed him again, it will be another matter.
In terms of appearance, your font files are not inline and are not OS fonts used.
If you upload files directly using the control that comes with your browser, the file will not be damaged.
If you use a third-party plug-in, you need to study it, or try another third-party plug-in.
If you want to upload a file stream, you must pack and compile the package before and after decompression. you can use functions such as serialize () to compile and store the package, and then unserialize the download, to ensure that the file stream will not be lost or deteriorated during transmission.
This PDF file was sent to me by someone else. it's okay to open it directly. This problem also occurs when I perform test upload on the local machine.
If there is no secret, you can put it on a cloud disk.
If there is no secret, you can put it on a cloud disk.
It's hard to figure out why some characters are lost after the upload.
Var_dump ($ _ FILES );
If ($ _ FILES ["file"] ["error"]> 0)
{
Echo "Error:". $ _ FILES ["file"] ["error"]."
";
}
Else
{
Echo "Upload:". $ _ FILES ["file"] ["name"]."
";
Echo "Type:". $ _ FILES ["file"] ["type"]."
";
Echo "Size:". ($ _ FILES ["file"] ["size"]/1024). "Kb
";
Echo "Stored in:". $ _ FILES ["file"] ["tmp_name"];
Move_uploaded_file ($ _ FILES ["file"] ["tmp_name"], "D:/Apache2.2/htdocs/javasjs/web/files /". $ _ FILES ["file"] ["name"]);
}
?>
Pdf address: http://pan.baidu.com/s/1i3qWHeP has time to test thank you
Use your programs and files to test successfully.
No problems found
Use your programs and files to test successfully.
No problems found
Does the uploaded pdf contain no characters! You can see
If the content is intact, it will not be pasted.
If the content is intact, it will not be pasted.
I just uploaded an lnmp environment in linux again. it may be due to environment configuration problems! I want to find another reason! Thank you.