I'm writing a test harness for a web page containing a dropzone.js element, let's call it myDropzone
, represented by the $('#my-dropzone')
element.
Question:
Can I use javascript to simulate dropping an uploadable file onto the dropzone?
I think (but I'm not sure) this might entail something like:
- Creating a file-like object in javascript, then
- Triggering a drop event on
myDropzone
.
Step #2 is easy, but step #1 involves creating a file-like object (containing real datastream?) that can actually be uploaded once it is dropped.
I've tried creating dummy files such as this and then using myDropzone.addFile(...)
, but that doesn't result in an uploadable file because there is no data payload.
thanks!