ImageKit.io allows you to upload a file (image and non-image) via API.
API v1
Based on your requirement, you can either:
- Upload file from a server using private API key-based authentication, or
- Upload file from client-side (in Javascript, or Android or iPhone app) using signature-based authentication.
Both methods use the same endpoint, but there is a slight change in the request bodies.
API v2
Based on your requirement, you can either:
- Upload file from a server using private API key-based authentication, or
- File upload from client-side (secure) (in Javascript or any client side application) using JSON Web Token authentication.
Both methods use the same endpoint, but there is a slight change in the request bodies.
{% hint style="info" %} File size limit
The maximum upload file size is limited to 25MB on the free plan. On paid plan, this limit is 300MB for video files. {% endhint %}
ImageKit.io supports the uploading of a wide range of file types, accommodating various formats from media files to documents.
- Binary files: Binary files, such as images, videos, and executables, are identified using the 'magic number'.
- Text files: Text files, such as HTML, CSS, and JavaScript, are identified using the file extension.
- Text files without extension: When a text file is uploaded without an extension, it is categorized under the content-type `application/octet-stream.’
The upload API can upload one file at a time. To upload files in bulk, write a program to loop through files and call upload API repeatedly. Leverage ImageKit.io server-side SDKs to implement bulk upload program.
Read how asset ownership are affected by this operation here.