Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--form dropzone--->
- <form id="my-dropzone-1" action="<?php echo site_url('welcome/addfoto') ?>" class="dropzone">
- <input type="hidden" class="form-control" name="id_product_post" >
- </form>
- <!---js dropzone--->
- var minImageWidth1 = 300,
- minImageHeight1 = 200;
- Dropzone.options.myDropzone1 = {
- acceptedFiles: "image/*",
- addRemoveLinks: true,
- accept: function(file, done) {
- console.log("uploaded");
- done();
- },
- init: function() {
- this.on("processing", function(file) {
- this.options.url = base_url+"welcome/addfoto";
- });
- this.on("addedfile", function() {
- if (this.files[1]!=null){
- this.removeFile(this.files[0]);
- }
- });
- this.on("thumbnail", function(file) {
- if (file.width < minImageWidth1 || file.height < minImageHeight1) {
- file.rejectDimensions()
- }
- else {
- file.acceptDimensions();
- }
- });
- },
- accept: function(file, done) {
- file.acceptDimensions = done;
- file.rejectDimensions = function() { done("Ukuran Sesuai kan"); };
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement