File Uploads using Uploadcare for HTML/Javascript
File Uploader:
File Uploader is supplied as a JavaScript library. It overrides an <input type=”file”> control on an HTML page with a button that opens up the File Uploader dialog. File Uploads using Uploadcare for HTML/Javascript. Uploadcare is a complete file handling platform for online business. Receive files from you users via File Uploader or File Upload API, implement image optimization and transformations with Image CDN API, and get HIPAA-compliant storage. Uploadcare is a tool in the File Uploads category of a tech stack.
Supported browsers:
The current File Uploader (v3) works in all modern browsers, desktop and mobile. Here’s a list of supported browsers:
Desktop
Mobile
Installation:
Dependencies
Uploadcare File Uploader doesn’t have any external dependencies except for jQuery. Generally, File Uploader comes in two versions: with and without jQuery.
Global installation:
For example:
NPM:
Image crop:
Uploadcare File Uploader features a good bunch of crop options, including free crop. Adding the feature to your File Uploader instance is done by implementing the data-crop option.
Note that it’ll add an additional step of image editing.
Configuring Crop:
Crop options are held inside the data-crop attribute as a comma-separated string with presets names. When you define several presets, users will be able to choose from the related crop options right in the UI.
Each crop preset is a combination of a size or ratio definition and an optional keyword:
i. “disabled”, crop is disabled. It can’t be combined with other presets.
ii. “” or “free”, crop is enabled. Users can freely select any crop area on their images.
iii. “2:3”, any area with the aspect ratio of 2:3 can be selected for cropping.
iv. “300×200” — same as above, but if the selected area is greater than 300×200 pixels, the resulting image will be downscaled to fit the dimensions.
v. “300×200 upscale” — same as above, but even if the selected area is smaller, the resulting image gets upscaled to fit the dimensions.
vi. “300×200 minimum” — users won’t be able to define an area smaller than 300×200 pixels. If an image we apply the crop to is smaller than 300×200 pixels, it will be upscaled to fit the dimension.
Crop examples:
Free crop: