dropzone.js

Jquery Dropzone dynamically change POST location

霸气de小男生 提交于 2021-01-03 06:34:15
问题 I have an issue regarding Dropzone.js, I am looking to be able to change the post URL dynamically such as : window.onload = function() { myDropzone = new Dropzone("#my-awesome-dropzone", { url: "upload_file.php" }); myDropzone.on("complete", function(file) { myDropzone.removeFile(file); }); } Where you see url: "upload_file.php", I would like to change this property as and when I need to, this to enable me to change the path that files are stored so i can do something similar to: url: "upload

Restrict Dropzone to upload only specific type of files

本小妞迷上赌 提交于 2020-12-31 14:51:59
问题 I am uploading files with Dropzone here is my code <div> <form id="mainDiv" class="dropzone needsclick" enctype="multipart/form-data" method="post" action="uploadFiles?type=5" role="form"> <div class="dz-message needsclick"> Drop files here or click to upload.<br /> <span class="note needsclick">(Please upload <strong>PDF, JPG, GIF, PNG, PDF</strong> files only.)</span> </div> </form> </div> <div> <form id="recommendationDiv" class="dropzone needsclick" enctype="multipart/form-data" method=

Restrict Dropzone to upload only specific type of files

会有一股神秘感。 提交于 2020-12-31 14:47:13
问题 I am uploading files with Dropzone here is my code <div> <form id="mainDiv" class="dropzone needsclick" enctype="multipart/form-data" method="post" action="uploadFiles?type=5" role="form"> <div class="dz-message needsclick"> Drop files here or click to upload.<br /> <span class="note needsclick">(Please upload <strong>PDF, JPG, GIF, PNG, PDF</strong> files only.)</span> </div> </form> </div> <div> <form id="recommendationDiv" class="dropzone needsclick" enctype="multipart/form-data" method=

Combine normal form with multiple dropzones

回眸只為那壹抹淺笑 提交于 2020-12-06 08:23:40
问题 I want to have multiple dropzones in a form. So I created a form <form method="post"> <div class="upload-files" data-name="mainImages[]" /> <div class="upload-files" data-name="secImages[]" /> <!-- could also be more --> <input type="text" name="test" /> <input type="submit" /> </form> The dropzones are initialized with its own paramName. var dropzones = []; $('.upload-files').each(function() { dropzones.push(new Dropzone('#' + $dropzone.attr('id'), { paramName: $(this).data('name'), // ... }

Combine normal form with multiple dropzones

拜拜、爱过 提交于 2020-12-06 08:23:08
问题 I want to have multiple dropzones in a form. So I created a form <form method="post"> <div class="upload-files" data-name="mainImages[]" /> <div class="upload-files" data-name="secImages[]" /> <!-- could also be more --> <input type="text" name="test" /> <input type="submit" /> </form> The dropzones are initialized with its own paramName. var dropzones = []; $('.upload-files').each(function() { dropzones.push(new Dropzone('#' + $dropzone.attr('id'), { paramName: $(this).data('name'), // ... }

dropzone.js direct upload to S3 with content-type

无人久伴 提交于 2020-12-05 03:17:53
问题 I'm currently using dropzone.js to upload images to S3 with a presigned URL. Everything works except I am unable to set the content-type of the file being uploaded. By default they are all being uploaded with binary/octet-stream and I am unable to view them directly in the browser. My S3 presigned policy looks like this: const policy = s3PolicyV4.generate({ key: key, bucket: process.env.S3_BUCKET, contentType: 'multipart/form-data', region: process.env.REGION, accessKey: process.env.ACCESS