"Files" property with javascript not working in Firefox, even though it's per Mozilla docs

Question Description

I’m trying to learn for my Programming class and I’m stuck. Can you help?

I'm using this javascript code, per Mozilla docs, but it's not working in Mozilla, just in Chrome and Opera.

var data = new FormData(document.getElementById("uploadform"));		
var selected_file = document.getElementById('file').files[0];	
data.append('file-0', selected_file);
firefox also causes server error on the ajax file upload:
[Wed Jun 05 21:34:53 2013] [error] [client ::1] PHP Notice:  Undefined index: file-0 in /home/jeff/public/ on line 11, referer: http://localhost/
I have no idea why the "files" property does not seem to be working on Firefox. Here's the relevant Mozilla docs page: Using FormData Objects.

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Final Answer

Thank you for the opportunity to help you with your question!

In most cases, the discipline is self-governed by the entities which require the programming, and sometimes very strict environments are defined

Please let me know if you need any clarification. I'm always happy to answer your questions.

fitting k (56)
Purdue University

I was on a very tight deadline but thanks to Studypool I was able to deliver my assignment on time.

The tutor was pretty knowledgeable, efficient and polite. Great service!

Heard about Studypool for a while and finally tried it. Glad I did caus this was really helpful.

Similar Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors