php escape method , php curl picture upload
I'm trying to upload some pictures using php cURL but the issue is that the names of the pictures are very weird . Basically they contain #$% signs like this
!Bw5kO2w!mk~$(KGrHqQOKjwEv开发者_运维知识库qEtNICrBMLHRIcc+!~~_1.JPG
The picture name is retrieved dynamically so I don't know how to escape the characters.
$image = "@".$imageDirectory.$picture[$picture_no];
The error that I'm getting is :
:0 cURL error: failed creating formpost data
Using urlencode() may help you http://php.net/manual/function.urlencode.php
精彩评论