0

I'm using FileDropJS to allow users to choose a local file and upload its content to the application.

I'm looking for a way to "choose" the same file automatically for the user, when the user comes back, without him having to drag & drop the file again every time he uses the application.

Is there an easy way to do it with FileDropJS? I looked into the docs but didn't find anything related.

Current code to allow to choose the file and assign its content to a JavaScript variable:

var file_zone = new FileDrop('file_file', file_options);
    file_zone.event('send', function (files) {
        files.each(function (file) {
            file.readData(
                function (str) {
                    file_content = str;
                    document.getElementById("file_file_label").innerHTML = '<i style="color:green;" class="fa fa-check-circle"></i> &nbsp;Thank you!';
                },
                function () { alert('Problem reading this file.'); },
                'text'
            );
        });
    });

Thanks!

Tom Shir
  • 462
  • 1
  • 3
  • 14

0 Answers0