I'm new to cloudinary and I want to upload multiple images directly to cloudinary from browser
My code is:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/jquery.fileupload-noscript.css" rel="stylesheet" />
<link href="css/jquery.fileupload-ui-noscript.css" rel="stylesheet" />
<link href="css/jquery.fileupload-ui.css" rel="stylesheet" />
<link href="css/jquery.fileupload.css" rel="stylesheet" />
<title></title>
<script src='http://code.jquery.com/jquery-1.11.1.min.js' type='text/javascript'></script>
<script src='js/jquery.ui.widget.js' type='text/javascript'></script>
<script src='js/jquery.iframe-transport.js' type='text/javascript'></script>
<script src='js/jquery.fileupload.js' type='text/javascript'></script>
<script src="js/jquery.cloudinary.js"></script>
<script>
$.cloudinary.config({ cloud_name: 'imagedb-com', api_key: '634138425488393' })
$(document).ready(function () {
var timestamps = timestamp();
alert(timestamps);
var data = '{"timestamp":' + timestamps + ',"callback":"http://localhost:1174/js/newjs/cloudinary_cors.html" ,"signature":"JuQVk6zYQi_kF_sT_AxHBg3upjY" ,"api_key":"634138425488393"}';
$('.cloudinary-fileupload').fileupload({
disableImageResize: false,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|bmp|ico)$/i,
maxFileSize: 20000000, // 20MB
formData: data
});
$('.cloudinary-fileupload').append($.cloudinary.unsigned_upload_tag("zcudy0uz",{ cloud_name: 'imagedb-com' }));
});
function timestamp() {
var last, diff;
last = event.timeStamp;
return last;
}
</script>
</head>
<body>
<input name="file" multiple type="file" class="cloudinary-fileupload" id="cloud" data-cloudinary-field="image_id" />
<input type="button" value="submit" id="btn-upload"/>
</body>
</html>
This gives me an error Bad Request. {"error":{"message":"Missing required parameter - file"}} Please Help me in doing this.
Can you please share which upload type you require? It seems that this code has a mix of both signed and unsigned uploads. For example, you use the
unsigned_upload_tag
method while also passing thetimestamp
,api_key
andsignature
which are required only for signed uploads.