jquery - Cloudinary Java direct upload BAD REQUEST error -
i used java 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 string model attribute , show on page. looks button "choose file".
picked image , jquery.fileupload tried send image cloudinary.
i took status code: 400 bad request , response:
error: {message: "upload preset must specified when using unsigned upload"}
all of settings right, can send image server side, using code:
map uploadresult = cloudinary.uploader().upload("image.jpg", objectutils.emptymap())
but can't send file 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 of cloudinary manuals, github issues, stackoverflow answers can't force working direct upload. please me, deal problem.
an upload preset must specified
error response means signature isn't passed part of upload options. can share url live webpage demonstrated?
can share demonstration of how input field generated (i.e., show under 'developer tools')?
if privacy issue, please feel free contact cloudinary's support team.
also, can have @ sample project(https://github.com/cloudinary/cloudinary_java/tree/master/samples)
Comments
Post a Comment