Hello, people.
I know that a good programmer can easily make sense in simple and primitive documentation like this in a minute, so asking you for help!
I need to make a drag and drop file uploader on my website with a list of files waiting in a separate section so I chose to use the “jQuery uploader” plugin and I am nearly done with the coding for this but stuck in the end.
github
demos
My problem is that I can’t manage to do the main part. That is to upload files on click.
This is how it looks like:
The only can that I can share (Because all the other parts don’t matter at all) is this:
Here I am creating the object, thats nearly copied from the original documentation. And at the bottom some of my own code.
[code]
$(document).ready(function(){
$(‘#drop-area’).dmUploader({
url: ‘scripts/launcher/launcher-xml/php/upload.php’,
onDragEnter: function(){
// Happens when dragging something over the DnD area
this.addClass(‘active-uploader’);
},
onDragLeave: function(){
// Happens when dragging something OUT of the DnD area
this.removeClass(‘active-uploader’);
},
onNewFile: function(id, file){
// When a new file is added using the file selector or the DnD area
add_file_to_queue(id, file);
},
onUploadCanceled: function(id) {
// Happens when a file is directly canceled by the user.
},
});
$(‘#files’).on(‘click’, ‘.upload-file svg’, function() {
object_id = $(this).parent().data(‘object-id’);
$(this).parent().remove();
$(“#drop-area”).dmUploader(“cancel”, object_id);
check_upload_available();
});
$(‘#start-xml-loading-button’).click(function() {
$(“#drop-area”).dmUploader(“start”);
});
});
Mainly I am interested in this:
[code]
$(“#drop-area”).dmUploader(“start”);
That is again copied from the documentation. This is supposed to start the file uploading by calling the php script that I specified in the URL at the top when I was creating the object.
I don’t get any errors or page reloading.
I also can’t check if all I have done before works because can’t see the array of files that are currently waiting for upload because the documentation does not specify the way to do so…
Also, the demo given does not use the button, it just starts the uploading automatically so I can’t see any examples of how to do this.
Please help