Dropbox Add-on feedback

Thanks for making the add-on. It’s fairly straight forward and behaves similar to the file upload field. These are the initial issues I’ve spotted when trying to get it running :

  1. It uses the depreciated $().live() which was removed since jQuery 1.9. Should be replaced with $().on() - see https://stackoverflow.com/questions/14354040/jquery-1-9-live-is-not-a-function
  2. It forces ssl also on localhost ( is_ssl() check in settings page ). Dropbox allows http when the hostname is localhost. Should also be reflected in the oauth url which defaults to https right now. Can be partially fixed / overridden with https://docs.gravityforms.com/gform_dropbox_ssl_compatibility/ I suppose, but the oauth url would still show “https://localhost
  3. Limit file extensions option has a wrong description. It says that you can define jpg,png. But the format that dropbox supports is : .jpg,.png
  4. There seems to be a multiselect option in the code-base, to allow for multiple files to be selected, but it doesn’t seem to show up in the dropbox button admin field
  5. Embedding with ajax seems buggy, as the dropbox javascript code seems to be added after the script tries to load, and so Dropbox is not defined error pops up. I got around it temporarily by adding the dropbox javascript code to my wordpress header, but when I open the forms multiple times, it adds multiple dropbox buttons. Maybe move the dropbox external script to be embeddable with gravity_form_enqueue_scripts($formid, true) instead

That’s my initial feedback

1 Like

Thank you for your thoughts. I’ll share them with the team.

  1. I’m also looking for events that are available with the MultiFile upload when a file was successfully added. For example when a file was added to the multifile uploader, we can listen for it like so :
    gfMultiFileUploader.uploaders.gform_multifile_upload_5_4.bind('FilesAdded', function(i, files) {});
    But the Dropbox field doesn’t seem to have a success callback / hook added. You could add it to the GFDropbox.uploadHandler function.

  2. (optional) you can limit the maximum filesize like with the multifile upload. The Dropbox option is called sizeLimit

  3. (optional) you could hook into the cancel event to allow the throwing of a soft error

  4. Documentation error: https://docs.gravityforms.com/gform_dropbox_link_type/ has the wrong code in the Example. It’s the example from gform_dropbox_store_local_version instead of for gform_dropbox_link_type

1 Like