Use data attributes on input instead of global variable.
Code cleanup.
Check files size once.
Clear new input file value.
Remove the drag and drop code in favour of browser builtin support.
Upload a single file selection with ajax too.
Added copyright notice.
Added missing script.
Created sandbox for ajax file upload.