PHP upload PDF file, some special characters are missing

Source: Internet
Author: User
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.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.