Uploaded image for project: 'PrestaShop 1.7'
  1. PrestaShop 1.7
  2. BOOM-4860

WebService : update image with PUT and CURL Command line

    Details

    • Type: Bug
    • Status: To Do
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.7.2.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • How to reproduce the issue ?:
      N/A
    • Tests & Expected Results:
      N/A
    • Documentation Change:
      N/A

      Description

      Hello,

      I comunicate with Prestashop by WebService and CURL command line (not in PHP).

      I do like that to send a picture and it work :

      curl -X POST -F image=@mypicture.jpg --User MyUserId: www;myshop.com/api/images/products/idProd -o prestashopAnswer.xml

      I'm trying now to update with this but it doesn't work :

      curl -X PUT -F image=@mypicture.jpg --User MyUserId: www;myshop.com/api/images/products/idProd/idimage -o prestashopAnswer.xml

      I receive the message "Please set an iamge parameter with image data value"

      If I try this :

      curl -X PUT -F image=@mypicture.jpg --User MyUserId: www;myshop.com/api/images/products/idProd/idimage/bin -o prestashopAnswer.xml

      I receive the message "This image does not existe on disk"

      I looked in the PHP files and I saw in the writePostedImageOnDisk function (WebServiceSpecificmanagementImages.php that $_FILES['image']['tmp_name'] is empty when I do the PUT. This why it can't save the image. Is it correct ?

       

       

        Attachments

          Activity

            People

            • Assignee:
              pablo.borowicz Pablo Borowicz
              Reporter:
              jcv jcvoyeux
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: