I have an HTML
form with a dropzone js
file upload. I want to post other form field information with the file. I tried this 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 to 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 this code I can only post the image not the title and location. How can I post the the title and location values with the upload information ?