I used Java for building Image upload tag:
Map options = ObjectUtils.asMap("resource_type", "auto");
options.put("callback", "http://localhost:8080/cloudinary_cors.html");
Map htmlOptions = null;
String html = cloudinary.uploader().imageUploadTag("image_id", options, htmlOptions);
Put this String to Model attribute and show on page. Looks like button "Choose file".
Picked some image and jquery.fileupload tried to send this image to Cloudinary.
I took Status Code: 400 Bad Request and response:
error: {message: "Upload preset must be specified when using unsigned upload"}
All of my settings is right, I can send image from server side, using this code:
Map uploadResult = cloudinary.uploader().upload("image.jpg", ObjectUtils.emptyMap())
but I can't send file from client side.
Code of page:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<script th:src="@{/js/common/jquery-1.11.3.min.js}" type="text/javascript"/>
<script th:src="@{/js/cloudinary/jquery.ui.widget.js}" type="text/javascript"/>
<script th:src="@{/js/cloudinary/jquery.iframe-transport.js}" type="text/javascript"/>
<script th:src="@{/js/cloudinary/jquery.fileupload.js}" type="text/javascript"/>
<script th:src="@{/js/cloudinary/jquery.cloudinary.js}" type="text/javascript"/>
</head>
<body>
<span th:utext="${cloudyURL}" th:remove="tag"></span>
<!-- config CloudinaryApi -->
<script th:inline="javascript">
$.cloudinary.config({"cloud_name":"CLOUDNAME", "api_key":"APIKEY"});
</script>
</body>
</html>
I read all of Cloudinary manuals, github issues, stackoverflow answers but can't force working direct upload. Please help me, deal with this problem.