• Stars
    star
    227
  • Rank 175,900 (Top 4 %)
  • Language
    JavaScript
  • License
    BSD 2-Clause "Sim...
  • Created about 12 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Uploadcare Widget, an ultimate tool for HTML5 file upload supporting multiple file upload, drag&drop, validation by file size/file extension/MIME file type, progress bar for file uploads, image preview.

Uploadcare Widget

Uploadcare Widget is an HTML5 file uploader, a part of the Uploadcare file handling platform.

NPM version Build Status Uploadcare stack on StackShare

Uploads affect your web or mobile app performance. The widget ensures you integrate file uploading into your product in minutes, no matter the development stack.

The widget features:

  • Drag&Drop selection.
  • Over a dozen upload sources including social media and cloud storage providers.
  • Multiple file upload with individual progress bars.
  • File moderation through validation by file size, extension or MIME type.
  • Image preview and image crop.
  • Libraries and integrations for JavaScript, PHP, Python, Java, Django, Ruby on Rails, Angular, and more.
  • 20+ languages, learn more.

We provide the file uploader as a typical JavaScript library; it can be easily embedded in your site.

Using the older 2.x version? Check out the stuff under the v2 tag.

Widget in action

Docs

See the complete widget docs here. If you're looking for the widget v2 docs, check out here.

Quick references

Types of bundles

There are a few types of JS bundles:

  • uploadcare.full.js β€” a full bundle with built-in jQuery.
  • uploadcare.js β€” a bundle without built-in jQuery.
  • uploadcare.api.js β€” a bundle without UI of the widget and built-in jQuery JavaScript API only.
  • uploadcare.lang.en.js β€” a bundle without built-in jQuery, en locale only.

Each bundle has its minified version. Just add .min before .js, e.g. uploadcare.min.js.

By default, uploadcare.js is exported for npm and other package managers.

Install

You’re free to choose from the install methods listed below.

NPM

npm install uploadcare-widget
import uploadcare from 'uploadcare-widget'

CDN

Embed our client library via the <script> tag in the <head> section of each page where you’d like to use Uploadcare Widget. Here is the CDN link to the current widget version with built-in jQuery,

<script src="https://ucarecdn.com/libs/widget/3.x/uploadcare.full.min.js" charset="utf-8"></script>

Or, if you’re already using jQuery on your page, consider loading the light version of the widget: without built-in jQuery,

<script src="https://code.jquery.com/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="https://ucarecdn.com/libs/widget/3.x/uploadcare.min.js" charset="utf-8"></script>

Other install methods

Check out the widget docs for more install methods.

Usage

Once you’re done with the install, there are two simple steps to take to use the widget.

Set your public key. This can also sit in the <head> section,

<script>
  UPLOADCARE_PUBLIC_KEY = 'YOUR_PUBLIC_KEY';
</script>

Your secret key is not required for the widget; (it’s quite careless for your page to include any secret keys anyway.

Insert widget element into your form,

<input type="hidden" role="uploadcare-uploader" name="my_file" />

By default, the library looks for inputs with the specified role attribute and places widgets there. Once a file is uploaded, this <input> gets a CDN link with a file UUID. Your server then receives this link, not file content.

We suggest placing the widget somewhere at the top of your form. Unlike regular inputs, our widget starts uploading files immediately after they get selected by a user, not on form submission. That way users can fill out the rest of your form while an upload is in progress. This can be a real time saver.

Usage with React

Check out our React component for Uploadcare Widget.

Usage with Angular

Check out our Angular 2+ wrapper for Uploadcare Widget.

angular-uploadcare can be used with Angular 1.

Configuration

The widget is highly customizable with widget options. Check out the existing options and ways to set them in UC docs.

JavaScript API

You might not want to use all the features that our widget exhibits. Or, perhaps, you might want to redesign the user experience without having to reinvent the wheel. Maybe, you're in pursuit of building a UI on top of the widget. For all of those use cases, we provide a JavaScript API. Feel free to control the default widget with it, or make use of its standalone components that can be combined with your solutions.

UploadClient

If you want to use Upload API directly and don't need a widget, try upload-client β€” a 7.3 kB JS library for uploading files.

Localization

It’s possible that your locale is not available in the widget yet. If that’s the case, contributing your locale might be a good idea. This can be done by forking the main repository and adding a localization file here.

Until that you can use UPLOADCARE_LOCALE_TRANSLATIONS property to use your locale immediately.

Browser Support

The widget should work perfectly in a couple of the latest versions of major desktop browsers: Internet Explorer, Edge, Firefox, Google Chrome, Safari, and Opera. It is most likely to run well in older versions of major browser too, except for Internet Explorer < 10.

If you need the support for older browsers including IE8, consider using the widget v2 instead.

Desktop Mobile
Chrome: 37+ Android Browser: 4.4+
Firefox: 32+ Opera Mobile: 8+
Safari: 9+ iOS Safari: 9+
Edge: 12+ IE Mobile: 11+
IE: 10+ Opera Mini: Last

Development

Check out the Uploadcare Widget development guide.

Security issues

If you think you ran into something in Uploadcare libraries which might have security implications, please hit us up at [email protected] 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 [email protected].

More Repositories

1

pyuploadcare

Build file handling in minutes. Upload or accept user-generated content, store, transform, optimize, and deliver images, videos, and documents to billions of users.
Python
126
star
2

uploadcare-php

PHP API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
PHP
100
star
3

react-widget

Uploadcare React Widget
JavaScript
84
star
4

file-uploader

Stack-agnostic library for uploading, processing, and editing images on-the-fly
JavaScript
62
star
5

uploadcare-js-api-clients

JavaScript library for work with Uploadcare API
TypeScript
58
star
6

uploadcare-rails

Rails API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Ruby
58
star
7

uploadcare-ruby

Ruby API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Ruby
39
star
8

uploadcare-node

Node module for uploadcare.com
JavaScript
37
star
9

uploadcare-summernote

Uploadcare plugin for Summernote WYSIWYG editor.
JavaScript
28
star
10

uploadcare-ios

UploadcareKit: iOS SDK for Uploadcare API
Objective-C
25
star
11

nextjs-loader

Uploadcare custom image loader for Next.js
TypeScript
21
star
12

uploadcare-redactor

Redactor Uploadcare plugin
JavaScript
18
star
13

uploadcare-picture

Create responsive picture with Uploadcare CDN.
JavaScript
17
star
14

uploadcare-netlifycms-depricated

JavaScript
17
star
15

email-list-verify

verify every email in file
JavaScript
16
star
16

ngx-uploadcare-widget

Angular 2+ wrapper for Uploadcare Widget
TypeScript
15
star
17

uploadcare-go

Golang API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Go
15
star
18

uploadcare-tinymce

JavaScript
13
star
19

uploadcare-wordpress

Uploadcare Widget like a plugin for WordPress
PHP
13
star
20

uploadcare-android

Android Upload widget and API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Kotlin
13
star
21

file-uploader-examples

The set of examples and code references of Uploadcare blocks integration
12
star
22

uploadcare-swift

Swift API client for iOS, iPadOS, tvOS, macOS, and Linux handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Swift
12
star
23

migro

Uploadcare migration tool.
Python
10
star
24

uploadcare-ckeditor

Uploadcare Widget like a plugin for CKEditor
JavaScript
10
star
25

intercom-rank

Intercom Rank adds the actual domain rank, language and a site description from Alexa for any lead in your Intercom dashboard.
Python
10
star
26

uploadcare-widget-tab-effects

Effects Tab for Uploadcare Widget. Edit images in a browser.
JavaScript
9
star
27

react-components

TypeScript
7
star
28

client-suspense

client only suspense for production
JavaScript
6
star
29

uploadcare-java

Java API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Java
6
star
30

uploadcare-loader

webpack loader with all the glory of http://uploadcare.com
JavaScript
6
star
31

uploadcare-php-example

PHP
5
star
32

uploadcare-drupal

PHP
4
star
33

image-fns

Toolset for manipulating images in a browser
TypeScript
4
star
34

safescript

Safest way to embed your script in HTML
JavaScript
3
star
35

ucr.io-frontend

Home page of UCR β€” Proxy Image CDN by Uploadcare
JavaScript
3
star
36

social-l10n

Social sources localization
JavaScript
3
star
37

uploadcare-joomla

PHP
3
star
38

uploadcare-bitrix

PHP
2
star
39

meteor-uploadcare-widget

The official Meteor package for the Uploadcare widget
JavaScript
2
star
40

eslint-config-uploadcare

Uploadcare's ESLint config
JavaScript
2
star
41

meteor-react-uploadcare-demo

JavaScript
2
star
42

uploadcare-rust

Rust API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
Rust
2
star
43

uploadcare-cakephp

PHP
1
star
44

ushare

JavaScript
1
star
45

stylelint-config-uploadcare

The shareable config for stylelint by Uploadcare team
JavaScript
1
star
46

uploadcare-ruby-next

Uploadcare Ruby integration handles uploads and further operations with files by wrapping Upload and REST APIs.
Ruby
1
star
47

uploadcare-jotform-widget

Uploadcare Widget like a widget for JotForm
JavaScript
1
star
48

pyuploadcare-example

Pyuploadcare Example app
HTML
1
star
49

uploadcare-haskell-deprecated

Haskell library for Uploadcare.
Haskell
1
star
50

pillow-border-radius

Fast accurate border-radius mask generator with CSS syntax
Python
1
star
51

uploadcare-woocommerce

Uploadcare plugin for WooCommerce
PHP
1
star
52

video-tutorial-1

HTML
1
star