Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What about PHP CURL post Datagram error failed creating formpost data

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "PHP CURL post data error failed creating formpost data how to do", the explanation content in the article is simple and clear, easy to learn and understand, please follow the small series of ideas slowly in-depth, together to study and learn "PHP CURL post data error failed creating formpost data how to do"!

When uploading logo pictures using curl to make WeChat card coupons, I found an error:

failed creating formpost data

The array in the code is as follows:

$data = array('buffer' => '@test.jpg');

Combined with the documents given by WeChat, check the syntax, it seems that no errors have been found...

After online query and verification, I finally found that the problem appeared at @ here, if you add a\escape in front of @, it can be mentioned in the official bugs.php.net of php (URL provided at the end of this article)

Final Code:

$data = array('buffer' => '\\@test.jpg');

Problem solved.

bugs address reference: bugs.php.net/bug.php? id=50060

Let's look at an example:

Before writing a php file upload code using curl, today exposed a bug, curl error message is "failed creating formpost data"

Let's talk about curl uploading files first

$file =array("upimg"=>"@/tmp/tmp.jpg");//file path, preceded by @, indicating file upload. $url = 'https://cache.yisu.com/upload/information/20201209/266/39801.jpg, and submit a profile, so that the parameter value is path ='/tmp/tmp.jpg', enter the profile desc ='@ test ha'; Thank you for reading, the above is the content of "PHP CURL post data error failed creating formpost data how to do", after the study of this article, I believe that everyone has a deeper understanding of PHP CURL post data error failed creating formpost data how to do this problem, the specific use situation still needs to be verified by everyone. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report