No description, website, or topics provided.
Clone or download
Latest commit e18072e May 23, 2018

README.md

File Uploader by Uploadcare

This is a plugin for TinyMCE, a WYSIWYG HTML editor, providing it for working with Uploadcare Widget.

The plugin allows TinyMCE users to upload media from their devices, social media, cloud storage, and more. All that without any backend code that's usually required to handle uploads.

GitHub release  Uploadcare stack on StackShare

Demo

Check out the basic demo here.

Requirements

TinyMCE 4+.

Install

Download the latest plugin archive from the release branch or releases page.

Extract the downloaded archive to the plugin directory of your TinyMCE installation.

Another option here is cloning the repo:

git clone -b release git@github.com:uploadcare/uploadcare-tinymce.git plugins/uploadcare

Usage

Add uploadcare to the list of your TinyMCE plugins and the toolbar. Set your public key. Public keys are used to identify a target Uploadcare project your uploads will go to.

tinymce.init({
  selector: '#editor',
  plugins: 'uploadcare',
  toolbar: 'uploadcare',
  external_plugins: {
    uploadcare: '/path/to/uploadcare/plugin.js',
  },
  uploadcare_public_key: 'YOUR_PUBLIC_KEY',
})

Configuration

Plugin configuration

To apply a custom configuration, initialize the TinyMCE editor providing additional options:

tinymce.init({
  selector: '#editor',
  plugins: 'uploadcare',
  toolbar: 'uploadcare',
  external_plugins: {
    uploadcare: '/path/to/uploadcare/plugin.js',
  },
  uploadcare_public_key: 'YOUR_PUBLIC_KEY',
  /* when handling images, you can resize them on a client to save bandwidth */
  uploadcare_image_shrink: '500x375',
  /* allow multi-file uploads */
  uploadcare_multiple: true,
  uploadcare_multiple_max: 3,
  /* set crop options when handling images */
  uploadcare_crop: '1:1,4:3',
  /* feel free to add more options here */
})

You can use any widget options providing those as object keys. Just add the uploadcare_ prefix and use snake_case instead of camelCase in option names, e.g. imagesOnlyuploadcare_images_only.

Widget configuration

Uploadcare Widget can be deeply customized to suit your UX/UI. You can define allowed upload sources, implement file validation, and more.

Use our live widget sandbox as a starting point and consider checking out the docs on widget configuration and its JavaScript API.

Security issues

If you think you ran into something in Uploadcare libraries which might have security implications, please hit us up at bugbounty@uploadcare.com or Hackerone.

We'll contact you personally in a short time to fix an issue through co-op and prior to any public disclosure.

Feedback

Issues and PRs are welcome. You can provide your feedback or drop us a support request at hello@uploadcare.com.