Dropzone Remove Drop Files Here to Upload

#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


#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


#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


#10023674

This respond has been marked as private.

#10023696

Hello Jonas,

I replaced all include references.

Simply the problem nevertheless remains.

Please assist.

Best Regards,

Sascha


#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.


#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.

https://www.myweg.de/temp/30-11-2017%2015-05-58.jpg

Best Regards,
Sascha


#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.


#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


#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.


#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


#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.


tufnellharrinat.blogspot.com

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

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel