on 06-05-2015 1:59 PM
Hi
Is it possible to upload a file, using SAPUI5,
from a known file location without the user
having to pick it himself (no file menu),
and sending it then to R3?
Thank you
Yuval
Yes.
But why would you want that..?
What you could do is use a file uploader control, and not "paint/render" it on the screen.
Set the uploadURL, then upload the file.
Documentation:
JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.unified.FileUploader
Sample code:
Though I really question allot of things..
Would you want to do this with SAPUI5?
Why would you want to do a silent upload to your R3 system?
Greetz,
Caspár
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you can read the text file as well from a file.
You may also read from a html file.
See below code.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons"
data-sap-ui-theme="sap_bluecrystal">
</script>
<!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
<script>
$.get('test.txt', function(data) {
console.log(data);
}, 'text');
// ^------last argument
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
This is the output.
The file test.txt is in webcontent folder.
See these links for references.
https://api.jquery.com/jquery.get/
javascript - Reading a text file with jQuery - Stack Overflow
javascript - jQuery to load text file data - Stack Overflow
javascript - Reading a file into a string in jQuery/JS - Stack Overflow
Regards
Dhananjay
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.