Skip to main content
Solved

Media Library upload using REST : unsupported content type png, jpeg and octet-stream

  • November 3, 2022
  • 4 replies
  • 391 views

Forum|alt.badge.img+10
  • Hero (Customer)
  • 71 replies

Hi everyone!

I’m using POSTMAN to upload documents to IFS Cloud 21R2 and have successfully uploaded to the document manager with many thanks to the people who provided the detailed information in this topic:

 

My requirement is to upload to the media library rather than the docman so I’ve also looked at this topic (again, many thanks to the contributors):

I’ve used MediaLibraryAttachmentHandling.svc/CreateAndConnectMedia to get the ItemId and then I’ve tried to patch with MediaLibraryAttachmentHandling.svc/MediaLibrarySet(LibraryId='1013') and also MediaItemHandling.svc/MediaItemSet(ItemId=1013). Whatever I try to upload fails with unsupported content type.

I tried just providing a png or a jpg file and let POSTMAN set the headers:

 

Following the instructions in the above post I then specifically set the content type, if-match and X-IFS-Content-Disposition

 

I can successfully upload both png and jpg as media files as a user.

Thanks in advance for any suggestions!

Best answer by Mathias Dahl

If you open Chrome's Dev Tools and keep the Network tab open you will see everything that is sent when the Aurena client does a media item upload. Did you try that, to see what headers it sets and what the values are?
 

View original
Did this topic help you find an answer to your question?

4 replies

Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2895 replies
  • Answer
  • November 3, 2022

If you open Chrome's Dev Tools and keep the Network tab open you will see everything that is sent when the Aurena client does a media item upload. Did you try that, to see what headers it sets and what the values are?
 


Forum|alt.badge.img+10
  • Author
  • Hero (Customer)
  • 71 replies
  • November 3, 2022

Hi @Mathias Dahl 

Many thanks for your quick response.

I hadn’t looked there and I should have done!  I was using the wrong API to upload the file, I should have been using MediaLibraryAttachmentHandling.svc/MediaItemSet(ItemId=1013)/MediaObject with the appropriate headers for octet-stream.

Thanks again for pointing me in the right direction!

 


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2895 replies
  • November 3, 2022

Great, thanks for reporting back. This thread might help others with the same or similar needs 💪🏻 

 


paul harland
Superhero (Employee)
Forum|alt.badge.img+24

there’s an explainer document here: 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings