dropzone.js

dropzone.js sends empty $_FILES

纵然是瞬间 提交于 2020-07-22 05:14:50
问题 I try to use dropzone.js to make a drag-and-drop file upload area and I'm getting really desperate here. I have this simplest script: <?php print_r($_FILES); ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> </head> <body> <form action="/" method="POST" enctype="multipart/form-data" class="dropzone"> <input name="file" type="file" /> <input type="submit" name="submit" value="Submit" /> </form> <script type=

dropzone.js sends empty $_FILES

六眼飞鱼酱① 提交于 2020-07-22 05:14:11
问题 I try to use dropzone.js to make a drag-and-drop file upload area and I'm getting really desperate here. I have this simplest script: <?php print_r($_FILES); ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> </head> <body> <form action="/" method="POST" enctype="multipart/form-data" class="dropzone"> <input name="file" type="file" /> <input type="submit" name="submit" value="Submit" /> </form> <script type=

Dropzone JS Change Filename Before Upload

社会主义新天地 提交于 2020-06-27 12:44:34
问题 I'm using Dropzone.js to handle uploading of files. I would really like to be able to modify the original name of the file before uploading it to S3. It would be nice to just be able to use dropzone's processing file hook like shown below, but it appears none of the changes I make to this file object persist... myDropone.on('processingfile', function(file) { console.log(file.name) // 'Randy.png' file.name = 'my-custom-name.png'; console.log(file.name) // 'Randy.png' }); Even when trying to

How to use Dropzone in Laravel 5 with existing form and submit everything by pressing a button

二次信任 提交于 2020-06-26 06:54:17
问题 I have: {!! Form::open(['route'=>'admin.some.store', 'method' => 'post', 'id' => 'creation-form']) !!} {!! Form::text('name', null, ['class' => 'form-control', 'id'=>'name']) !!} {!! Form::text('name1', null, ['class' => 'form-control', 'id'=>'name1']) !!} {!! Form::button('Submit', ['class' => 'btn btn-primary', 'type'=>'submit']) !!} {!! Form::close() !!} I need to to use dropzone.js with such a form. I need to submit all the data of my form and images to the same controller at once. How

Dropzone. Manually upload AcceptedFiles via Ajax

自作多情 提交于 2020-05-17 07:26:08
问题 I have a submit function via ajax that get values from a form via jQuery. There are multiple dropzones, which I need to grab from upon pressing the submit button for the entire form. I can access the dropzones file objects like this: $('#foobar')[0].dropzone.getAcceptedFiles()[0] which gives me something like this: File ​ _removeLink: <a class="dz-remove" href="javascript:undefined;" data-dz-remove=""> ​ accepted: true ​ dataURL: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD

Dynamically update Dropzone maxFiles setting

随声附和 提交于 2020-03-27 05:57:09
问题 Dropzone.options.dropzone = { uploadMultiple: false, maxFiles: {{ imagecount }}, maxFilesize: 2, // MB dictFileTooBig: "That image is too large. We only allow 2MB or smaller.", acceptedFiles: ".jpeg, .jpg", init: function () { this.on("success", function(file, response) { $('.uploaded-photos').append('<div><img src="' + response.link + '"height="150" class="photo" id="' + response.id + '"/><span class="delete-photo">Delete</span></div>'); $('.uploaded-photos').justifiedGallery('norewind')