I'd like to know how to trigger the Dropzone.js' default file upload input? It's not as simple like this:
window.dropCloud = = new Dropzone("#dropCloud", {...});
$(window.dropCloud.clickableElements[0]).trigger("click");
Now i don't have any ideas. Anyway the whole #dropCloud
container is hidden, if it matters.
Follow following the below steps and upload file using dropzone js and jquery without refreshing the whole web page in PHP: First of all, create an index.php file and update the below HTML code into your index.php file. This HTML code shows the image upload form, so using this form you can upload the images on the DB table and project folder.
Now, Click on Submit button, to submit form (you can add more more values), you will receive files in your controller, take a look at the below image, which shows that two files name "pdf.pdf" and "meditation.jpg" has been posted to C# Controller from Dropzone.
Ultimately, the logic to select or handle the drag and drop files and upload them to the server will be contained within the DropZone.js file. Import the DropZone component from the components directory and add it to the index.js file in the pages directory. The index.js file will be used to render the application.
Create a <form > element where add class='dropzone' and set action='upload.php'. From upload.php file handle file upload when a file is selected. 3. PHP Create a new upload folder for storing files and a upload.php file. Use move_uploaded_file () method to store the file to upload directory. 4. CSS Create a style.css file. 5. Demo 6. Conclusion
This seems to work great for me
var dropZone = new Dropzone($("#yourdropzonedivthinger").get(0), {
BLAH BLAH BLAH drop zone init stuff
});
//Call this anywhere in your code to manually trigger the dropzone file dialog popup thinger
dropZone.hiddenFileInput.click();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With