Amirul Momenin
Posts: 0
Joined: Tue Apr 08, 2014 3:42 am

Image Upload

http://jsfiddle.net/JHQnk/1659/

How will I run this into Appery

Logan
Posts: 0
Joined: Tue Sep 20, 2016 11:26 am

Image Upload

Hi Amirul Momenin.

You can use that code wherever you want.

E.g If you want to use that code on some button's "onclick" event then you can write that code in "runjavascript" action of that button.

Logan.

Amirul Momenin
Posts: 0
Joined: Tue Apr 08, 2014 3:42 am

Image Upload

Not working
can you check this
var handleFileSelect = function(evt) {

Code: Select all

alert(1) 

 var files = evt.target.files; 
 var file = files[0]; 

 if (files && file) { 
     var reader = new FileReader(); 

     reader.onload = function(readerEvt) { 
         var binaryString = readerEvt.target.result; 
   data = 'data:'+file.type+';base64,'+ btoa(binaryString); 
   document.getElementById("base64textarea").value = data; 
    document.getElementById("image").src = data;  

     }; 

     reader.readAsBinaryString(file); 
 } 

};

if (window.File && window.FileReader && window.FileList && window.Blob) {
document.getElementById('filePicker').addEventListener('change', handleFileSelect, false);
} else {
alert('The File APIs are not fully supported in this browser.');
}

Amirul Momenin
Posts: 0
Joined: Tue Apr 08, 2014 3:42 am

Image Upload

I need just binary data of file
You can show any other example

Image

pls look the screnshoot

Logan
Posts: 0
Joined: Tue Sep 20, 2016 11:26 am

Image Upload

Send me some screenshots of how you wrote that code and where?

Amirul Momenin
Posts: 0
Joined: Tue Apr 08, 2014 3:42 am

Image Upload

How will I pass event?
This is main problem

Amirul Momenin
Posts: 0
Joined: Tue Apr 08, 2014 3:42 am

Image Upload

Image

Ok finally I solve this

Amirul Momenin
Posts: 0
Joined: Tue Apr 08, 2014 3:42 am

Image Upload

Amirul Momenin
Posts: 0
Joined: Tue Apr 08, 2014 3:42 am

Image Upload

var files = event.target.files;
for(i=0;i).src = data;
alert(data)

Code: Select all

 };  
 reader.readAsBinaryString(file);  
 }  

}

Logan
Posts: 0
Joined: Tue Sep 20, 2016 11:26 am

Image Upload

Hi Amirul Momenin.

Thanks for details.

Is there any error in console log or is there any alert that you used for errors?

Logan.

Return to “Issues”