Skip to main content

Upload widget add custom instructions

Comments

7 comments

  • Maor Gariv

    Hi,

     

    Thanks for reaching out.

     

    Yes:)

    You can use the Client side actions parameters to set max size limit ('max_file_size'), max number of files ('max_files'), minimum dimensions ('min_image_width', 'min_image_height') etc. 

    For more information and options,

    http://cloudinary.com/documentation/upload_widget#upload_widget_options

    0
  • Castelis-Phoenix

    I think I should have clarified a bit more what I need.  It's actually more of a UX question.  The max height, width, etc. are already set in the widget options. I just don't want the person to upload something and see the error AFTER they try an image that's not the right dimensions.  We want instructions shown before the user tries to upload the image in the widget.

    We currently have the instructions on the web page but it's ugly.  I am simply trying to print the instructions on the widget itself.  

    I'm thinking that this isn't possible via the api, but I'd still like to be able to access the widget itself with a simple script for appending text.  Any ideas?

    0
  • Maor Gariv

    Thanks for the clarification.

     

    You can add custom text in the widget's window by using the `text` parameter. See this widget implementation for example (simply add cloud_name and an upload preset) - 

    https://jsfiddle.net/ush3pept/

    In addition, it's possible to have your own stylesheet for more customised look and feel.

    For more options see the "Customization" section in the upload widget options.

    0
  • Castelis-Phoenix

    Aha Thanks!  I had looked through the options and somehow 'text' didn't jump out at me.  Anyway, it works, though I can't get sources.local.drop_files string to be recognized by the sources.local.drop_or does print my text.

    This will work though it would be great to be able to style the string.  HTML tags are printed and not rendered and it also doesn't recognize \n or \r for line endings in the string I send to the text option.

    If you have any tips on that it would be great, otherwise I can make do with a basic line.

     

    0
  • Maor Gariv

    Hi,

     

    Customised text styling is currently not supported but I'll pass it on to the team for further review and discussion.

     

    Thanks for your suggestion!

    0
  • Satish Suggala

    Hello, Thanks to this post I am able to add custom text on the widget but is there any way I can add formatting like a new line in the message or use a different variable.

    For example I am doing this 
    "sources.local.drop_or": "Drop Files here <br> Only mp4 files are supported!"

    but I am not able to get the message to next line using br

    0
  • Brian Luk

    Hi Satish, for custom text in the widget, we only support single lines. You could also set the `resourceType` to `video` in the configuration, and use an upload preset to normalize the uploaded videos to `mp4`s.

     

    0

Post is closed for comments.