cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP Image Content Type

08-23-2021 11:03 AM
Cristian Participant
1526 views 3 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi experts,

I have an entity which includes an image and the image file type (png, jpg ...) as follows:

    arquitectureViewImage : LargeBinary @Core.MediaType: arquitectureViewImageType
    @description: 'Reference architecture diagram image';

    arquitectureViewImageType : String(60)  @Core.IsMediaType
    @description: 'Reference architecture diagram image type';

Once uploading the image, the image gets uploaded successfully and I am able to retrieve it but the field for the image type is always empty. How this field needs to be uploaded? I am passing it in the Content-Type of the PUT request (e.g. image/jpeg) but no luck.

Many thanks!

C.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

gregorw
SAP Mentor
SAP Mentor

Please check out the example media/test/media.http. You have to create the metadata first with a POST. Then you can upload the binary data.

Cristian
Participant
0 Likes

Many thanks! I was expecting so. Thought the framework could do it in just one call.

Regards,

M.

Answers (1)

Answers (1)

vitaly_kozyura
Advisor
Advisor
0 Likes

We added to the runtime the ability to set content-type from streaming request header to the media type property of the entity (in case it exists). The feature to be provided with the next release. Regards, Vitaly