Search code examples
excelinputuploadcopy-pastejquery-file-upload

Pasting from Excel with jQuery File Upload on page causes upload


To boil it down, I have two inputs on the page. One is a text input, the other is a file input. If I copy and paste an Excel spreadsheet cell to the text input, it triggers a file upload to the file input. I'd like to allow copy-paste without triggering the file upload.


Solution

  • The key here is to set the pasteZone to null

    $("#fileupload").fileupload({
        pasteZone: null   //make it $(document) or specific container for enabling it
    })
    

    Documentation

    Credit