Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
What is the problem of <input type="file"/> .docx file type in Google Chrome?

I have an

<input type="file" accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"> 

like above to accept the .doc and .docx files. When I printed the file object to in Google Chrome console, .docx file type becomes empty. But in Firefox console, file type becomes not empty.

Here is my javascript function of input file change event;

var control = document.getElementById("upload-file");
control.addEventListener("change", function(event) {

    var files = control.files,
    for (var i = 0; i < files.length; i++) {
        console.log("Filename: " + files[i].name);
        console.log("Type: " + files[i].type);
        console.log("Size: " + files[i].size + " bytes");
    }
}, false);

Google Chrome Console Output enter image description here

Firefox Console Output enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could try using the file extension ?

Using the same accept attribute:

<input type="file" accept=".doc, .docx, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document">
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!