Skip to Content
author's profile photo Former Member
Former Member

Upload File with parameters?


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!



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jul 03, 2013 at 01:46 PM

    Hi Daniel

    DJ Adams recently gave an example of how to use the SAPUI5 FileUploader control,

    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

    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.


    John P

    stream1.png (69.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 13, 2014 at 10:28 AM

    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.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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...)



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.