When building a website or an app, you'll need to handle uploading, storing, processing, and delivering various files, either from you, or from your users. We have various uploading methods, a few storage options, an API to manage files, and a CDN with on-the-fly processing capabilities. Everything is compliant with numerous international regulations.
- This page is about our latest File Uploader. Docs on the previous uploader are available here.
You can either install File Uploader from CDN, or via NPM.
<script type="module"> import * as LR from ""; LR.registerBlocks(LR); </script>html
File Uploader can be presented in a few ways, e.g. regularly, inline or minimalistic.
Regular File Uploader:
<lr-config ctx-name="my-uploader" pubkey="YOUR_PUBLIC_KEY" ></lr-config> <lr-file-uploader-regular css-src="https://cdn.jsdelivr.net/npm/@email@example.com/web/lr-file-uploader-regular.min.css" ctx-name="my-uploader" ></lr-file-uploader-regular>html
lr-config is a configuration block, and
lr-file-uploader-regular is a File Uploader block.
ctx-name attribute is used to wire up the configuration block with the File Uploader block.
css-src attribute is used to specify basic CSS styles.
To dive further, check out configuration guide.
Here you can find examples how to integrate it into your stack of choice:
Once a file is uploaded, it goes to your Uploadcare storage and instantly becomes available on CDN.
(By default, Upload API doesn't store the files forever. There is a 24-hour window when you should decide whether to store uploaded files or not. But all of our official libraries, including File Uploader, inherit the auto-store setting from your project, where it's set to ON by default. You can read more about storage behavior).
You can get the UUID of the uploaded files immediately on upload. For example:
Please refer to the Events page to view the complete list of available events and learn how to utilize multiple instances of the file uploader on the same page.
We recommend saving UUIDs instead of CDN URLs because this will let you process these files easier later on.
You can add image processing operations by including directives in the CDN URL:
Imagine you're building a service with a lot of street photos:
- You'll need to optimize the size and quality of the images for page load time.
- You'll have to blur the faces on the photos to comply with privacy laws.
- You'll want to add your watermark to every picture.
Construct the value of the image
src attribute template, adding the operations
you pick, and use this template for every street photo in your project:
-/resize/1200x/ -/quality/smart/ -/format/auto/ -/blur_region/faces/ -/overlay/2f44b1c2-f71a-4f84-bbe2-6d96c7e35a2d/100p,100p/
See the full list of image processing operations.
- Lear more about uploading files options.
- Integrate Uploadcare into your mobile app with native SDKs.
- Implement secure workflows for uploading and delivering files.
- Fetch and deliver remote files without explicitly uploading files.
- Add arbitrary metadata, remove image background, recognize objects, process videos, convert documents, and detect viruses.
- Explore project settings.
- Migrate your files to Uploadcare.