Iam trying to read file,and need to take that base64 value and pass it as input for some webservice.
While doing this process,to read the file it is taking some time.
Before reading my file it is going to further steps,and iam getting base64 value as empty.
Any suggestion is highly appreciable for me.I tried to keep timeout while reading,but it is not working.
Below is sample code
- if(input.files.length!=0)
- {
-
- for(i=0;i<input.files.length;i++){
- var fileReader = new FileReader();
- filname=input.files[i]["name"];
-
- fileReader.readAsDataURL(input.files[i]);
-
-
- fileReadContent = fileReader.result
- fileReadContent=fileReadContent.split(",");
- fileReadContent.shift();
- if(fileReadContent!="")
- storecontent();
- else
- alert("Data not available")
- }
- }