Comments (11)
I know about this and tries this but not all browsers support setting file's input value even to empty value. Notably Opera won't allow it.
Does it fix IE at least?
from filedrop.
The input.files property is read-only, but you can set the value for the input to be "".
I will change the code in my "fork", so you can see that I'm talking about.
from filedrop.
The change for that is the following:
rafaelmaiolla@7efc0fa
I don't know if that is the proper place to add this code, but this worked on Chrome and will probably work on IE.
from filedrop.
Like I've said it (still) doesn't work on IE but at least it works on Chrome and Firefox (tested). Implemented in 528f2ca. Thanks for another correction.
from filedrop.
You can make it work on IE too. But you need to remove the old input and add a new one in its place.
The following stackoverflow post explain how to do it using jQuery by cloning the old one, but you can do it on hand.
http://stackoverflow.com/questions/1043957/clearing-input-type-file-using-jquery/1043969#1043969
from filedrop.
I'm not sure it's a good idea to swap the input every time - it will lose all event bindings which might have been added outside of FIleDrop as well.
I will think about this though.
from filedrop.
I understand your concerns.
And I can implement the work-around for IE by myself...
If someone else need it, the code is the following (using jQuery - and of course this code is outside the library):
var $input = $(fileDrop.el).find(":file");
$input.replaceWith($input.clone());
fileDrop.opt.input = null;
fileDrop.hook(fileDrop.el);
from filedrop.
I will actually implement this in the next update with an option to disable input recreation (will be enabled by default). So stay tuned.
from filedrop.
Great!
from filedrop.
Implemented in 276e066. Turned out to be not so trivial (who would have guessed IE clones "by reference" and triggers submit once per every clone even after removing the old input?).
opt.recreateInput
is true by default so your fix should be redundant now.
from filedrop.
thanks for that, I will download the newer version.
from filedrop.
Related Issues (20)
- Using FileDrop as standard input element HOT 4
- File without parameter name in post request HOT 1
- Not Receiving $_FILE in PHP HOT 2
- [questions] Status of this project / plans HOT 2
- Upload but not saved HOT 7
- Documentation/progressbar, suggestion of adding comment or CCS for demo
- file.type seems doesn't work for several files HOT 8
- Traditional ASP Forms Application Usage HOT 1
- Can I get returned data from the `sendTo()` function? HOT 1
- Change Url Dynamically HOT 3
- Clear the drop area HOT 1
- File Drop js is not working in strict mode
- Please add a license
- Files of the same name are ignored when uploading directories HOT 2
- Click to upload only allowed once HOT 2
- move_uploaded_file HOT 3
- MIME type before upload? HOT 1
- request function, fd.serialize(form) HOT 1
- file name problem HOT 1
- Publish to NPM.js HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filedrop.