homepage Welcome to WebmasterWorld Guest from 54.225.57.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Upload the same file
Rain_Lover




msg:4678289
 5:16 am on Jun 8, 2014 (gmt 0)

You cannot select and upload the same file except in Firefox, which mistakenly allows you to do so:

<input type="file" id="fileChooser">
document.getElementById('fileChooser').onchange = function () {
alert('Uploaded!');
};


Here [jsfiddle.net]'s my approach to resolve the issue. I wonder if there's a neater way to achieve it.

 

Rain_Lover




msg:4678291
 5:49 am on Jun 8, 2014 (gmt 0)

Update

This one seems more semantic to me: [jsfiddle.net...]

Rain_Lover




msg:4678302
 9:36 am on Jun 8, 2014 (gmt 0)

Last update:

This one works well in IE11: [jsfiddle.net...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved