JCV Posted February 19, 2018 Share Posted February 19, 2018 (edited) Hello, I'm trying to update image by webservice using curl command line. To post, I do it like that : curl -F [email protected] --user Mykey: www.mysite.com/api/images/pictures/Idprod -o response.xml To put, I do it like that : curt -X PUT -F [email protected] --user Mykey: www.mysite.com/api/images/pictures/Idprod -o response.xml I'm not good in PHP but I looks in the Webservice code and I saw that $_FILES['image']['tmp_name'] was not charged in case of PUT so it can't store my picture. Have you another method to update images or is somebody found the solution ? Thank you JC Edited February 19, 2018 by JCV (see edit history) Link to comment Share on other sites More sharing options...
JCV Posted February 20, 2018 Author Share Posted February 20, 2018 (edited) I receive no solution then I modified the WebserviceSpecificManagementImages.php. Now I can update an image like this : curl -F [email protected] --user MYKEY: www.myshop.com/api/images/pictures/idprod/idpict -o answer.xml It is a POST with : idprod = id of the prodct idpict = id of the image to replace I know now why the doc of presta 1.6 said use POST rather PUT, I think it is because the picture file is lost with PUT. WebserviceSpecificManagementImages.php Edited February 20, 2018 by JCV (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now