EduLeonPavon Posted August 15, 2013 Share Posted August 15, 2013 Hello, I´m trying to add a manufacturer image via WS but I receive this error: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code><![CDATA[66]]></code> <message><![CDATA[unable to save this image]]></message> </error> </errors> </prestashop> I think that the image permissions is related with the problem: <manufacturers xlink:href="http://localhost/myweb/api/images/manufacturers" get="true" put="false" post="false" delete="false" head="true" upload_allowed_mimetypes="image/gif, image/jpg, image/jpeg, image/pjpeg, image/png, image/x-png"/> I am using a .NET program with PrestaSharp to update the manufacturers. You can find the source code from GitHub: https://github.com/E...von/PrestaSharp You can see the settings of my web service in the attached file. Thanks in advance. 1 Link to comment Share on other sites More sharing options...
hectorgomis Posted September 9, 2013 Share Posted September 9, 2013 (edited) I have the same problem, anybody solved this? Edited September 9, 2013 by hectorgomis (see edit history) Link to comment Share on other sites More sharing options...
EduLeonPavon Posted September 9, 2013 Author Share Posted September 9, 2013 Hi! hectorgomis, the problem is solved. Please, take a look in my code: https://github.com/EduLeonPavon/PrestaSharp In fact, the problem wasn´t related with PrestaShop core. If you have a doubt, please contact with me again Link to comment Share on other sites More sharing options...
hectorgomis Posted September 9, 2013 Share Posted September 9, 2013 Thanks EduLeonPavon, I'm going to try updating my project and I will tell you about that!! Link to comment Share on other sites More sharing options...
hectorgomis Posted September 9, 2013 Share Posted September 9, 2013 Thanks a million! It is working correctly! Link to comment Share on other sites More sharing options...
dszmaj Posted May 22, 2015 Share Posted May 22, 2015 ok, great, but what with people having the same exact problem and not speaking .NET? could you explain what worked for you, I can't find answer in your code? Link to comment Share on other sites More sharing options...
dszmaj Posted May 22, 2015 Share Posted May 22, 2015 ok, great, but what with people having the same exact problem and not speaking .NET? could you explain what worked for you, I can't find answer in your code? ok i found, there is an error in official documentation parameter for the request should be "image" not "images" as stated here http://doc.prestashop.com/display/PS15/Chapter+9+-+Image+management Link to comment Share on other sites More sharing options...
moh Posted November 23, 2018 Share Posted November 23, 2018 Bonjour, je travaille sur php et j'ai ce meme probleme d'insertion d'image pour un produit pourriez vous m'aider la dessus svp function addImage($idProduct) { $key = 'UVJJQ3HT8RHUPGDKE4LNZ21K973PAA84'; $url = "http://myshop/api/images/products/".$idProduct."/"; $image_path = 'file:///C:/wamp/www/api/image.jpg'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: image/jpeg')); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_USERPWD, $key); curl_setopt($ch, CURLOPT_POSTFIELDS, array('name' => 'Foo', 'file' => $image_path)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); var_dump($result); curl_close($ch); print_r($result); echo '<h2>Image Added</h2>'; } merci d'avance pour vos réponses 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