Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

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

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

  • 2 replies
  • 85 have this problem
  • 16 views
  • Last reply by 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; } } } }