The PHPGD library cannot process post-uploaded images.

Source: Internet
Author: User
Code {code ...} running Environment: Win64-apache2.4.9-php5.5.12Ubuntu64-apache2.4.7-php5.5.9 I Baidu Google checked a lot, can be determined: GD library has been enabled (successfully processed verification code and output) folder permissions normal (read and write files successfully) & amp; lt ;?...Code

  
Running environment:

Win64-apache2.4.9-php5.5.12
Ubuntu64-apache2.4.7-php5.5.9

I have checked a lot on Baidu/Google. You can confirm that:
  • The GD library has been enabled (the verification code is successfully processed and output)

  • The folder permission is normal (the file is successfully read and written)

  • NO content before

Tried these:
  • An error occurred while outputting the uploaded file directly.


    
  • Read and output the Server File.

 
  • Failed to rename the uploaded file and output it.

 
  • Read and output the file uploaded in the previous session.

 
The test tool is Chrome Postman:
  • Successful:

-Failed:

All the Code involved:

       330,'y'=>339);//    $position_source=array('x'=>0,'y'=>0,'w'=>288,'h'=>402);//    setPicture($target, $source, $position_target, $position_source);//    header("Content-type: image/png; charset=utf-8");//    header("Content-type: image/png;");//    imagepng($target); //    imagedestroy($target);    //    $target=imagecreatefrompng($_FILES['test']['tmp_name']);//    var_dump($_FILES);

Reply content:Code

       
Running environment:

Win64-apache2.4.9-php5.5.12
Ubuntu64-apache2.4.7-php5.5.9

I have checked a lot on Baidu/Google. You can confirm that:
  • The GD library has been enabled (the verification code is successfully processed and output)

  • The folder permission is normal (the file is successfully read and written)

  • NO content before

Tried these:
  • An error occurred while outputting the uploaded file directly.


         
  • Read and output the Server File.

 
  • Failed to rename the uploaded file and output it.

 
  • Read and output the file uploaded in the previous session.

 
The test tool is Chrome Postman:
  • Successful:

-Failed:

All the Code involved:

            330,'y'=>339);//    $position_source=array('x'=>0,'y'=>0,'w'=>288,'h'=>402);//    setPicture($target, $source, $position_target, $position_source);//    header("Content-type: image/png; charset=utf-8");//    header("Content-type: image/png;");//    imagepng($target); //    imagedestroy($target);    //    $target=imagecreatefrompng($_FILES['test']['tmp_name']);//    var_dump($_FILES);

The problem basically lies in the difference between the $ _ FILES path and the absolute path. We recommend that you print $ _ files out.

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.