php - How to post other form fields with dropzone js? -


i have html form dropzone js file upload. want post other form field information file. tried code,

html

<script src="dropzone/dist/dropzone.js"></script> <link rel="stylesheet" href="dropzone/dist/dropzone.css">  <form role="form" id="my-awesome-dropzone" method="post" action="photos/post"  enctype='multipart/form-data'>      <input type="text" name="title" id="title" class="form-control input-lg" placeholder="title" >      <input type="text" name="location" id="location" class="form-control input-lg" placeholder="location">      <div class="dropzone dz-clickable" id="mydrop">         <div class="dz-default dz-message" data-dz-message="">             <span>drop files here upload</span>         </div>      </div>     <input type="button" value="post" id="post-btn"> 

javascript

<script type="text/javascript"> var mydropzone = new dropzone("div#mydrop", {     url: "photos/post",     autoprocessqueue: false,     uploadmultiple: true,     addremovelinks: true,     paralleluploads:3,     maxfiles : 3,        });  $('#post-btn').on('click',function(){              mydropzone.processqueue(); }); 

but using code can post image not title , location. how can post the title , location values upload information ?

you can check out http://www.dropzonejs.com/#tips

mydropzone.on("sending", function(file, xhr, formdata) {   // send filesize along file post data.   formdata.append("filesize", file.size); }); 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -