0
var filepath="path of a file";
var txtFile = new File(filepath);
Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
SameerKhan1406
  • 289
  • 5
  • 18

1 Answers1

2

The error says "2 arguments required". So you need two arguments.

Try

var txtFile = new File([""], filepath);

see How to instantiate a File object in JavaScript?

Community
  • 1
  • 1
Mark Lakata
  • 19,989
  • 5
  • 106
  • 123