0

I have generated a PDF from itextpdf, now I want to upload this PDF file to "cloudinary" and save the link of uploaded portable document file in database. I can use both jquery and java for this purpose. I think that "cloudinary" returns json data and link can be taken from this json data?

Marko Popovic
  • 3,999
  • 3
  • 22
  • 37
shubham
  • 1
  • 3

1 Answers1

0

Using Cloudinary's Java library, something like this should be what you're looking for:

import com.cloudinary.Cloudinary;

Cloudinary cloudinary = new Cloudinary();
Map response = cloudinary.upload("my_file.pdf", ObjectUtils.asMap("resource_type", "raw"));
String url = (String) response.get("url");
// Add url to database

Regarding configuration parameters for secure API calls

Doing it manually is more involved (sans Cloudinary's libary), but I can take you through it if you'd like.

Drazen Bjelovuk
  • 5,201
  • 5
  • 37
  • 64