Quick Start
This step-by-step guide will help you get started with Uploadcare, enabling you to upload files into your web application with a plug-and-play File Uploader widget and deliver them efficiently.
Uploadcare is a file management platform and CDN designed for user-generated content. It offers a powerful API for uploading, storing, optimizing, transforming, and delivering files.
File Uploader is a highly customizable widget that allows users to securely and efficiently upload files from various sources. It leverages the capabilities of Uploadcare APIs and is compatible with any web tech stack.
Before you begin
To get started, you need an Uploadcare account.
If you’ve never used Uploadcare before, sign up for a new account
If you already have a Uploadcare account, log in to get started
Your new account will be free to explore all Pro plan features during the trial.
Integrate File Uploader
File Uploader can be integrated into apps using your preferred web tech stack.
See all available integrations.
Follow these steps to integrate the uploading widget into your application using JavaScript.
Create project
Projects are independent environments with unique API keys, dedicated storage, and other settings. You can create multiple projects for one account. When creating a project, select the Built-in storage option.
Get API Key
Retrieve the public API key from the project you created. You’ll need this key in next steps.
Install widget
Copy and paste the following script into the body of your application where you want the widget to appear:
Learn more about other installation options for uploading widgets.
This example uses a regular
configuration, where the uploading widget can handle
files from sources such as a local device, URL, camera, or Dropbox.
View in CodeSandbox
Receive files
Once installed, the File Uploader widget is ready to receive files from users. Uploaded files are added to your project and stored in Uploadcare storage.
You can view all uploaded files in the Files section or get a List of files programmatically via REST API.
Deliver files
Each uploaded file is assigned a unique identifier (UUID) and
becomes accessible via Uploadcare’s CDN:
https://ucarecdn.com/:UUID/
Uploadcare CDN lets you deliver files by embedding their URLs into your application.
Get file URL
There are 3 ways to get the URL of the uploaded file:
-
Programmatically, using uploading widget API and events.
-
By enabling webhooks to receive notifications whenever a file is uploaded.
-
Using HTML form.
HTML-form example
After the file is uploaded, all data, including the file URL, is sent to the form’s handler, where the uploading widget is embedded.
Optimize images
Image format conversion to AVIF or WebP is enabled by default for all files loaded into a project. You can disable it in the Delivery section of the Dashboard.
You can use the built-in adaptive image web component to automate responsive image delivery, improving load times and performance across various devices for your users.
-
Connect the script:
-
Configure basic settings:
-
Use
<uc-img>
tag for the images in your HTML templates:The component will generate adaptive image sets to be cached in the CDN.
-
Specify a list of breakpoints:
The browser will select the most suitable image size automatically.
You can also automatically compress all images in the project without quality loss if necessary.
Enable adaptive quality toggle in the Delivery section
of the Dashboard. This feature works only after with any URL-based transformation,
such as the preview
operation, is applied.
Applying a preview
size of 1024x1024 to an image resizes it to fit within a 1024x1024
square while preserving its aspect ratio. When the auto format and adaptive quality
toggles are enabled, the image is automatically delivered in the most suitable
format with an optimized compression level:
https://ucarecdn.com/:UUID/-/preview/1024x1024/
|
|
Transform images
Modify images, resize them, and apply filters or watermarks using URL-based transformations. Each transformation creates a new cached version of the image on the fly while the original file remains untouched.
Make a thumbnail of the original image, resize
it, and make it grayscale:
https://ucarecdn.com/:UUID/-/resize/100x/-/grayscale/
Original image | Thumbnail |
Next steps
Continue your Uploadcare journey and unlock the full potential of your projects:
- Learn more about other uploading options and transformation operations.
- Migrate your files to Uploadcare if you have already used another solution.
- Implement secure workflows for uploading and delivering files.