Dropzone with jquery and its parameters

I am using dropzone to attach files and upload, I do not want to bind the dropzone to form elements, since I cannot put the form inside the form,

So, I have bound it to a div element using jquery,

I can load the document correctly with this, but I cannot find a way to provide the parameters when used as jquery,

below are my codes,

I have linked the dropzone as a class and an id.If I drop the class then the dropzone does not bind to the div and I cannot attach the file.

 <div class="dropzone" id="dropzoneattach">

 </div>

      

Here is JQuery,

$("#dropzoneattach").dropzone({ 
paramName : 'userfile',
url: "<?php echo base_url()?>index.php/news/add_attachments",
});

      

why I am linking with this is because I want the filename to be loaded as a user file, not a file.

That being said, I cannot download the file,

If something is wrong? How to give dropzone options when the dropzone is created programmatically, I tried to look in the documentation but could not figure out

Thanks in advance.

+3


source to share


1 answer


Finally I found myself, Below is just bound to a class,



$(".dropzone").dropzone({ 
paramName : 'userfile',
url: "<?php echo base_url()?>index.php/news/add_attachments"
)}

      

0


source







All Articles