Content-Type in REST
Greetings to all!!!How to get the value of the Content-Type field from the object of the class %Stream.Object obtained with:
stream=% request.GetMimeData (FormDataName, 1)I tried:
write stream.GetAttribute("Content-Type")write %request.Get("Content-Type")
but always returns a void, although it should be "image/jpeg", "application/pdf" or something like that.
In JS:
var formData = new FormData(); formData.append('file', element[0].files[0]); console.log(element[0].files[0].type);
The console of browser displays "image / jpeg", "application / pdf", etc.
Discussion (2)0
Comments
write stream.ContentTypeProvided stream is an object of %CSP.Stream class.
What is the value of %request.ContentType?