File Uploads May 18, 2020 by Anna Rud

How to Upload Images to Your Website with Uploadcare

Whether you’re building an eCommerce website, SaaS application, social media platform, or any other website or app, chances are you’ll have to deal with image uploading.

Developing image upload and cropping plugins from scratch can take a day or longer, which might feel like too long if you’re developing an MVP or small side project, or simply want to get your project off the ground as soon as possible. 

That’s where Uploadcare comes in to help you handle your image uploading in a matter of minutes. This article will tell you more about the platform’s capabilities and then walk you through the process step by step. Let’s get started! 

Uploadcare Image Uploading Capabilities 

  • Uploadcare covers every aspect of your image handling: image uploads, storage, delivery, and processing. Every image uploaded to Uploadcare Storage gets cached by a CDN and can be safely and reliably delivered across 288K servers in 136+ countries and nearly 1,500 networks.  
  • Image uploading can be implemented on a frontend, backend, or CMS. 
  • To upload an image, a user might have it in a local folder, Google Drive, Dropbox, OneDrive, Instagram, Facebook, Evernote, Flickr, etc. It also supports uploading images from URLs. 
  • Drag & Drop option is available.
  • Uploadcare’s image uploading service also allows you to adjust image size and quality, and apply effects. 

The technology is extremely versatile, enabling fast file transfers from anywhere in the world.

Step 1: Sign Up and Create an Account 

Before we start, you need to sign up with Github or Google and set up your Uploadcare account, which usually takes no longer than 3 minutes. 

Stop spending weeks on what you can do in minutes.

After specifying your name and some basic user information, you’ll need to add your credit card details to start the 14-day trial period.

Step 2: Create a Project and Grab Your Public Key

After that, you’ll be able to create your first project from the dashboard.

On the API Keys tab, you’ll find the Public Key for your project. This key is needed to identify which account and project the uploaded file will belong to. We’ll need this key in the next step.

Getting your public key
Copy it and jump to the next step

Step 3: Add a Widget to a Page with Just a Few Lines of Code 

To put a ready-made image uploading service on any page of your website, add the following lines to your <HEAD> tag:

<script>UPLOADCARE_PUBLIC_KEY = "demopublickey";</script>
<script src="https://ucarecdn.com/libs/widget/3.7.4/uploadcare.full.min.js" charset="utf-8"></script>

This piece of code will add the widget to your website and identify your project. Change demopublickey to your own Public Key that you found in your account in the previous step.

Then add this line to the place on the page where you want your upload widget to appear: 

<input type="hidden" role="uploadcare-uploader" name="my_file" data-images-only=”true” />

Don’t forget to change my_file to your name attribute. It could be avatar or background or anything else that describes this file’s function. 

When everything is added, the “Choose an image” button will appear on the page.

When a user clicks on the button, they will see this image upload widget on your website:

Here’s what it looks like

Step 4: Customize Your Image Uploader

If the widget is a good fit for you, you can use it as-is. If not, Uploadcare gives you lots of configuration options so you can adjust the image uploader to your specific needs. Here are just a few things you can change: 

  • Allow selecting and uploading multiple files;
  • Set maximum and minimum numbers of files that can be selected for a single upload;
  • Allow file, PDF, and video uploading of up to 5 TB in size;
  • Define the in-widget manual crop behavior so that users can select a crop area when uploading images;
  • Set custom localization options;
  • Customize uploader’s appearance to fit your app or website.

Find the full list of widget options here.

And There You Have It! 

Uploadcare takes care of all your headaches related to image uploading: instead of spending hours or days developing your own solution from scratch, you can add a few lines to your code and get a ready-made, highly customizable image uploader in a matter of minutes. 

This saves a ton of time and allows you to focus on the unique features of your app or website rather than reinventing the wheel again and again. 

If you have additional questions about Uploadcare’s image uploading service or want to dive deeper into the capabilities, you can read the documentation, ask the community, or schedule a demo

Give Uploadcare a try today, and see how easy it is to build fast, high-quality image uploading into your website or app!

Give Uploadcare a try today, and see how easy it is to build fast, high-quality image uploading into your website or app!

Leave a comment

*

*