Dropzone Remove Drop Files Here to Upload
November 3, 2017 at 9:35 am #10023324
Hello Rodrigo,
how can I alter the cord Drop files here to upload?
https://www.myweg.de/ePorto/User/test.php
Thank you.
Best Regards,
Sascha
November iii, 2017 at 10:08 pm #10023328
Hello, yous can alter all the strings, only add this JS:
(js/theme.custom.js)
Dropzone.epitome.defaultOptions.dictDefaultMessage = "Drop files here to upload"; Dropzone.image.defaultOptions.dictFallbackMessage = "Your browser does non back up drag'northward'drop file uploads."; Dropzone.prototype.defaultOptions.dictFallbackText = "Delight utilize the fallback form beneath to upload your files like in the olden days."; Dropzone.prototype.defaultOptions.dictFileTooBig = "File is besides big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB."; Dropzone.paradigm.defaultOptions.dictInvalidFileType = "You lot tin can't upload files of this blazon."; Dropzone.paradigm.defaultOptions.dictResponseError = "Server responded with {{statusCode}} code."; Dropzone.prototype.defaultOptions.dictCancelUpload = "Cancel upload"; Dropzone.prototype.defaultOptions.dictCancelUploadConfirmation = "Are you sure you lot want to cancel this upload?"; Dropzone.prototype.defaultOptions.dictRemoveFile = "Remove file"; Dropzone.prototype.defaultOptions.dictMaxFilesExceeded = "You can not upload any more than files."; Kind Regards,
Jonas
November 29, 2017 at 9:49 am #10023666
Hello Jonas,
I tried to utilise the "dropzone" in the following link:
https://www.myweg.de/ePorto/User/test.php
The code is <form activeness="/upload" class="dropzone dz-square" id="dropzone-example"></form>.
Why do it not appear?
Thanks.
Best Regards,
Sascha Khan
November 29, 2017 at nine:07 pm #10023674
This respond has been marked as private.
November thirty, 2017 at 8:38 pm #10023696
Hello Jonas,
I replaced all include references.
Simply the problem nevertheless remains.
Please assist.
Best Regards,
Sascha
November 30, 2017 at 10:49 pm #10023706
Howdy Sascha,
The trouble is that you are putting the dropzone <class> within another <form id="class">.
For test purpose, put the dropzone form subsequently "primary" div, you will see that works.
<div role="main" class="principal"> <form activeness="/upload" grade="dropzone dz-foursquare" id="dropzone-instance"></form>
* Basically you can't put <form> within some other <course>.
Kind Regards,
Rodrigo.
Dec 1, 2017 at 1:x am #10023720
Hello Rodrigo,
I understand.
How can a form br realzied such like this?
It has a textarea, a dropzone and two buttons in one course.
Best Regards,
Sascha
Dec 1, 2017 at 5:27 am #10023724
Hello Sascha,
If you need the dropzone inside a course, y'all can initialize the dropzone programmatically.
1) HTML instance:
<form> <div id="my-dropzone"></div> </form>
2) (js/custom.js):
$(document).prepare(function(){ $("div#my-dropzone").dropzone({ url: "/upload" }); $("div#my-dropzone").addClass('dropzone'); }); Kind Regards,
Rodrigo.
Dec i, 2017 at iv:48 pm #10023729
Howdy Rodrigo,
your solution works.
Give thanks for that.
The previous settings for translation is now not working.
What must I modify now?
All-time Regards,
Sascha
December 1, 2017 at 11:04 pm #10023737
Hello Sascha,
Laissez passer the options of translation on intialization of plugin, like the lawmaking beneath:
$(document).ready(role(){ $("div#dropzone-test").dropzone({ url: "/upload", dictDefaultMessage: "Drop files hither to upload", dictFallbackMessage: "Your browser does non support drag'n'drop file uploads.", dictFallbackText: "Please use the fallback course below to upload your files like in the olden days.", dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", dictInvalidFileType: "Y'all can't upload files of this type.", dictResponseError: "Server responded with {{statusCode}} code.", dictCancelUpload: "Cancel upload", dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", dictRemoveFile: "Remove file", dictMaxFilesExceeded: "You can not upload any more files." }); $("div#dropzone-test").addClass('dropzone'); }); Kind Regards,
Rodrigo.
December three, 2017 at 12:56 am #10023744
Hi Rodrigo,
I changed at present the code as you recommended.
Upward to here it works as expected. I come across the dropzone in my grade. I see the texts in german. I tin select files. And the other entries and buttons are too bachelor and usable.
Now I want to procedure the selected file(s). Commonly in PHP the $_FILES object is ready. But here it is not set. It is NULL.
When calling my PHP file count($_FILES) provides 0. It must be greater 0.
What is the mistake?
Best Regards,
Sascha
December 4, 2017 at 11:31 pm #10023754
Hello Sascha,
Lamentable but we can't support it, since the server side implementation is responsibleness of the heir-apparent.
Below are some instructions, hope that help you:
The dropzone plugin realize a XHR (AJAX) to ship the file to destiny binder, so you need to create a separated file to transport the files to upload binder.
Here is a adept tutorial with a PHP lawmaking that you can employ:
https://www.startutorial.com/manufactures/view/how-to-build-a-file-upload-form-using-dropzonejs-and-php
* In that tutorial the dropzone don't is initiated programmatically (with JS lawmaking), so y'all volition need to implement parts of this tutorial with your current code,
To see the AJAX response of dropzone when you select a file to send, change your JS lawmaking to:
$(document).ready(function(){ $("div#dropzone-test").dropzone({ url: "/upload.php", dictDefaultMessage: "Drop files here to upload", dictFallbackMessage: "Your browser does not support elevate'n'drop file uploads.", dictFallbackText: "Please employ the fallback course below to upload your files like in the olden days.", dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", dictInvalidFileType: "You can't upload files of this type.", dictResponseError: "Server responded with {{statusCode}} code.", dictCancelUpload: "Cancel upload", dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", dictRemoveFile: "Remove file", dictMaxFilesExceeded: "You lot can not upload whatever more files.", sending: function(file, xhr, formData) { console.log(xhr); } }); $("div#dropzone-test").addClass('dropzone'); }); * This will testify on browser console the response of dropzone ajax.
* This is good to debug possible PHP errors.
Kind Regards,
Rodrigo.
Source: https://www.okler.net/forums/topic/drop-files-here-to-upload/
0 Response to "Dropzone Remove Drop Files Here to Upload"
Post a Comment