Problem with binary upload to a web handler - Forum - Mobile - Progress Community

Problem with binary upload to a web handler

 Forum

Problem with binary upload to a web handler

This question is not answered

Hi,

In the past we've transferred images captured via a mobile device over to a JSDO using a base64 encoded longchar parameter.

Would it be more sensible with the new PAS web-handler to transfer via a post request and a content type of application/octet-stream?

We've tried but we can't seem to store the porequest:entity back to a file.  Is there a way of finding out the type of the porequest entity so we cast to the correct type?

Regards

Dale

All Replies
  • PASOE is well-suited for this: you can use a WebHandler to return both the binary and JSON/temp-table data, or use PASOE to service the ‘mobile’ requests and ‘web’ (image) requests in the same server from the same ABL application.
     
    Take a look at the examples at github.com/.../img_handler . It also shows how you could work with multipart data.
     
  • Hi Peter,

    Thanks for the advice and link to the sample code.  I had searched through the forums and noticed some posts with similar code but had failed getting it to work correctly.  I've also come across the upload file samples that work fine with the Kendo file upload widget but I couldn't get my simple POST of binary data to work with a similar web handler. Basically I'm trying to upload an image from a nativescript mobile app using the angular2 http module to a PAS web-handler.  I'll have a good look at your sample which I'm sure will help.  

    Thanks again.