Inhalte aufrufen

Profilbild

WebApi Product picture upload Updating not working if extension is different


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
2 Antworten zu diesem Thema

#1 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 30 April 2020 - 16:14

Let's say i first upload a productpicture via the /api/{version}/Uploads/ProductImages endpoint with an .jpg fileextension. Then i want to update this productpicture with a .png extension and will also set the "PictureId" parameter in the form-data. Then the server processes without any error but the response tells me the original .jpg file isn't replaced. If I test the same in the same way but then with the same file extension then the files do get replaced by the newly uploaded one.
 
Edit:
 
Tried to reproduce it with the SmartStore.WebApi.Client and everything worked fine. After doing this my application also worked fine? So don't know exactly what happend…
Will do some more testing. If it occurs again I will let it know.

Question:

Does it matter if filename and PictureID are in a different order?

The document states this:
 

Content-Disposition: form-data; name="my-file-1"; filename="Background_2.png"; PictureId="3824

 
But it my application I send it like this:
 

Content-Disposition: form-data; name="my-file-1"; PictureId="3824; filename="Background_2.png"

Bearbeitet von TripleNico, 30 April 2020 - 16:30,


#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 30 April 2020 - 17:35

 

Does it matter if filename and PictureID are in a different order?

 

No.


Marcus Gesing

Smartstore AG


#3 TripleNico

TripleNico

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 124 Beiträge

Geschrieben: 01 May 2020 - 08:04

Thanks for confirming that.