on 10-16-2015 11:57 AM
Hello Experts,
In my project i came across a requirement where there are lots of records in a CSV file and i have to create all the records using Batch Operation upon clicking the upload button.
Can you please help me how to read the data of the file in the runtime , what i feel is that i have to know the url of my local file first and then read the file data using AJAX but am not getting any clue for how to get the url of the file during run time.
Please help me in this.Thanks in advance.
Regards,
Vikash
Hi Vikash,
<FileUploader xmlns="sap.ui.unified"
uploadUrl=""
buttonText="{i18n>detailBtnImport}"
fileType="csv"
maximumFileSize="1"
buttonOnly="true"
icon="sap-icon://upload"
change="onChangeFUP"
uploadComplete="onUploadCompleteFUP"
typeMissmatch="onFailedFUP"
fileSizeExceed="onFailedFUP"
uploadAborted="onFailedFUP"
filenameLengthExceed="onFailedFUP"/>
onChangeFUP : function(e) {
this._import(e.getParameter("files") && e.getParameter("files")[0]);
},
_import : function(file) {
if(file && window.FileReader){
var reader = new FileReader();
var that = this;
reader.onload = function(e) {
var strCSV= e.target.result; //string in CSV
};reader.readAsText(file);
}
@Raman Sharapinski Comment.
var strCSV= e.target.result; //string in CSV - Here you will get your csv file records
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.