0

I have read to documentation on how to add optional parameters to cloudinary's jquery function that is used to directly upload to the cloud. It the photo is uploaded to the cloud correctly, however I want to pass to the cloudinary_fileupload function either an upload preset, or a transformation in the function itself. I have tried alot of things to no avail. Here is my code

   $(function () {
      $('#direct_upload input[type="file"]').cloudinary_fileupload(
        { dropZone: '#direct_upload'},
        {"transformation": "c_limit,h_400,w_400",
         "tags":"123"}

I have also tried

 $(function () {
      $('#direct_upload input[type="file"]').cloudinary_fileupload(
        { dropZone: '#direct_upload',
         "transformation": "c_limit,h_400,w_400",
         "tags":"123"},

and other variations but nothing has worked! Thanks in advance

Max Larrain
  • 77
  • 1
  • 8

1 Answers1

0

I figured it out. You have to pass your incoming transformations in your form field directly in your django code, not your jquery code. Like so:

image = CloudinaryJsFileField(
        attrs = { 'style': "margin-top: 30px" }, 
        options = { 
          'tags': "directly_uploaded",
          'crop': 'limit', 'width': 500, 'height': 500},
        required=False
          )
Max Larrain
  • 77
  • 1
  • 8