Thomisback Posted December 8, 2008 Share Posted December 8, 2008 Hi, I'm trying to post some variables and upload a picture with CURL, I have been searching for hours and i'm really stuck. Part of my code: $parameters = array("file" => "@test.jpg", "othervars" => "true"); etc...etc... curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); The error I get is: failed creating formpost data It is this bit which causes the error: "file" => "@test.jpg" While the image is in the same folder! Does anyone see what's wrong with my script? Thanks a lot Link to comment https://forums.phpfreaks.com/topic/136099-solved-curl-multipartform-data-upload/ Share on other sites More sharing options...
Thomisback Posted December 9, 2008 Author Share Posted December 9, 2008 Anyone? Link to comment https://forums.phpfreaks.com/topic/136099-solved-curl-multipartform-data-upload/#findComment-710278 Share on other sites More sharing options...
Thomisback Posted December 9, 2008 Author Share Posted December 9, 2008 Got it, the path of the picture was wrong... Link to comment https://forums.phpfreaks.com/topic/136099-solved-curl-multipartform-data-upload/#findComment-710292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.