Search code examples
filepicker.io

Plug the window or modal directly to file button


I am just allow user to upload file via computer so I don't really need the pop-up.

Is that possible to plug the filepicker window directly to <input type="file"> so when user click choose file button. It direct open OS file window instead of open filepicker ?


Solution

  • You can use the filepicker.store() API for exactly this purpose - https://developers.inkfilepicker.com/docs/web/#store

    var input = document.getElementById("store-input");
    filepicker.store(input, function(InkBlob){
            console.log("Store successful:", JSON.stringify(InkBlob));
        }, function(FPError) {
            console.log(FPError.toString());
        }, function(progress) {
            console.log("Loading: "+progress+"%");
        }
    );