Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Call Servlet from view.js

$
0
0

I want to a get file from user and convert it into some other format.

I used java servlet for this and it works when I call the servlet from Html body tag.

But I want to call servlet from view.js UploadFile.

Here is my Html and view.js code

Where I have to mention the servlet call

 

<body class="sapUiBody" role="application">

               <div id="content"></div>

         <div>

                                   <form action="FileUploadServlet" enctype="multipart/form-data"  method="GET">

                                                       <input type="file" id="file" name="file">

                                                       <input type="Submit" value="Upload File">

                                   </form>

        </div>

  </body>

</html>

 

view.js

 

var f=new sap.ui.commons.FileUploader('file',

                                                                                          {

                                                                                                    uploadUrl : "/test-resources/",

                                                                                                    uploadOnChange : true,

 

                                                                                           }

 

 

2013-11-27 16_16_47-Clipboard.jpg

 

 

 

Even not only servlets I can use any tech. But It should allow me to call a java method.

Any idea? Please suggest some way to do this.

Thank you in advance


Viewing all articles
Browse latest Browse all 8124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>