Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Mulongo oyo etiyamaki na archive. Tuna motuna mosusu soki osengeli na lisalisi

A error: files.item(0).getAsDataURL is not a function .

  • 2 biyano
  • 85 eza na bankokoso oyo
  • 16 views
  • Eyano yasuka ya cnuvasu

more options

getAsDataURL is a javascript ,It ‘s show a picture. In firefox 6,It's ok,but in firefox 7 ,have a error: files.item(0).getAsDataURL is not a function . who can help me ? thanks.

getAsDataURL is a javascript ,It ‘s show a picture. In firefox 6,It's ok,but in firefox 7 ,have a error: files.item(0).getAsDataURL is not a function . who can help me ? thanks.

All Replies (2)

more options

The documentation says: The File interface's non-standard methods getAsBinary(), getAsDataURL(), and getAsText() have been removed as well as the non-standard properties fileName and fileSize. See:
https://developer.mozilla.org/en/Firefox_7_for_developers#DOM
https://developer.mozilla.org/en/DOM/File

more options

image preview working for me please find code......

var reader = new FileReader();

function preview(what) { if(jQuery.browser.msie || jQuery.browser.safari || jQuery.browser.chrome) { document.getElementById("preview-photo").src=what.value; return; } else{ // array with acceptable file types var accept = ["image/png","image/jpeg","image/jpg","image/gif"];

// if we accept the first selected file type if (accept.indexOf(what.files[0].type) > -1) { if(what.files && what.files[0]){ reader.readAsDataURL(what.files[0]); document.getElementById("preview-photo").src=reader.result; } } } }