Reputation: 277
I created a drag and drop interface for image upload using dropzone plugin.
This is the code that I'm using:
<script src="<?php echo base_url() ?>acc/assets/dropzone/dropzone.js"></script>
<form action="<?php echo base_url() ?>acc/assets/dropzone/upload.php"
class="dropzone" id="my-awesome-dropzone">
</form>
I also wrote the php code for uploading images and it is working.
The problem is there is no remove buttons for removing an image from the drop area. How can I enable that button?
Upvotes: 3
Views: 9154
Reputation: 10947
you can read how to configure it here: http://www.dropzonejs.com/#toc_6
for create options to a dropzone that you create by simply using the dropzone class, you need to create an object called after your form's id.
Dropzone.options.myAwesomeDropzone = {
//options here
}
To add a remove or cancel button, you have to pass the option addRemoveLinks
<script src="<?php echo base_url() ?>acc/assets/dropzone/dropzone.js"></script>
Dropzone.options.myAwesomeDropzone = {
addRemoveLinks: true
}
<form action="<?php echo base_url() ?>acc/assets/dropzone/upload.php" class="dropzone" id="my-awesome-dropzone"></form>
You can also take a look at this options:
Upvotes: 7