on 07-01-2013 5:58 PM
Hi,
I need to upload a file with NetWeaver Gateway. The file should not be stored as such, but processed by an ABAP class. Besides the file the class also needs some parameters. How do I implement something like this?
One approach I found is to have a PUT request to /path/to/service/EntitySet('SerializedParameters')/$value. But since my client side technology is SAPUI5 (HTML5), PUT request do not seem to be possible (Browsers only support GET and POST).
Ideally I would do a POST to /path/to/service/EntitySet that contains the file as well as the parameters. How would the request have to look like? (And how could I generate it with SAPUI5?)
Thank you for your help in advance!
Regards,
Daniel
Hi Daniel,
Did you find answer to your question of passing other property values along with file ? I read in a blog that one can pass values using Header 'Slug'. But i was not convinced as its just one field and what if you have 5 other properties in your entity.
Please help, if you found solution.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
no, we did not really find a solution that was feasable in our context.
Yes, you can use the Slug header. But unformtuantely you cannot set this header in a standard HTTP POST coming from an HTLM form. (You can do it using AJAX in conjunction with the file API, but this only works for Internet Explorer 10+.)
We solved it by creating another simple BSP application where we were more flexible (though this does not follow any standard and by-passes the Gateway...)
Regards,
Daniel
Hi Daniel
DJ Adams recently gave an example of how to use the SAPUI5 FileUploader control,
http://scn.sap.com/message/14165831#14165831
In his example you will see it is a POST call and has additional parameters.
I haven't used this control with a Gateway service, i am not sure how you would set the additional HTTP headers which are needed, I am thinking you may need to extend the FileUploader Upload method so it does an Ajax call instead of the uploadForm.submit .
The following thread maybe of help
http://scn.sap.com/thread/3262540
I would start by getting the service call working in the Gateway Client, it will look something like
This is a working example you should be able to find in your system.
Cheers
John P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.