PHP upload pdf file, upload to the server found in the PDF file some special characters do not display, the PDF file compressed into a zip file upload, prompting the compression package corruption
Ask the expert to answer
Reply to discussion (solution)
When PHP uploads a file, it does not break the file content. This can be seen from uploaded images as shown
Of course, if you do this to him again, it's another matter.
From the surface, your font file is not inline and is not the font used by the operating system
If you upload your browser's own control directly, you will not be able to destroy the file.
If you use a third-party plugin, you should look into it, or try a third-party plugin.
If you are a file stream, you should pay attention to the unpacking and compiling before and after the decompression, you can use serialize () functions such as compile, save, download and then unserialize, to ensure that in the process of transmission of the file stream will not be lost or spoiled.
This PDF file is passed to me by someone else, directly open no problem. I do the test upload in this machine is also this problem.
If there is no secret, you can put him on the cloud disk.
If there is no secret, you can put him on the cloud disk.
Now it's unclear why some characters are missing after uploading.
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). The Kb
";
echo "Stored in:". $_files["File" ["Tmp_name"];
Move_uploaded_file ($_files["File" ["Tmp_name"], "d:/apache2.2/htdocs/pdfjs/web/files/". $_files["File" ["Name"]) ;
}
?>
PDF Address: Http://pan.baidu.com/s/1i3qWHeP You have time to test.
Use your programs and files to test success
No problems found
Use your programs and files to test success
No problems found
Open uploaded pdf no characters really! can look at the
The content is intact, it is not affixed
The content is intact, it is not affixed
I just re-built a LNMP under Linux. Environment upload also no problem, it may be the environment configuration problem! I'll look for the reason! Thank you.