Class: Imagekitio::Resources::Beta::V2::Files
- Inherits:
-
Object
- Object
- Imagekitio::Resources::Beta::V2::Files
- Defined in:
- lib/imagekitio/resources/beta/v2/files.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Files
constructor
private
A new instance of Files.
-
#upload(file: , file_name: , token: nil, checks: nil, custom_coordinates: nil, custom_metadata: nil, description: nil, extensions: nil, folder: nil, is_private_file: nil, is_published: nil, overwrite_ai_tags: nil, overwrite_custom_metadata: nil, overwrite_file: nil, overwrite_tags: nil, response_fields: nil, tags: nil, transformation: nil, use_unique_file_name: nil, webhook_url: nil, request_options: {}) ⇒ Imagekitio::Models::Beta::V2::FileUploadResponse
Some parameter documentations has been truncated, see Models::Beta::V2::FileUploadParams for more details.
Constructor Details
#initialize(client:) ⇒ Files
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Files.
103 104 105 |
# File 'lib/imagekitio/resources/beta/v2/files.rb', line 103 def initialize(client:) @client = client end |
Instance Method Details
#upload(file: , file_name: , token: nil, checks: nil, custom_coordinates: nil, custom_metadata: nil, description: nil, extensions: nil, folder: nil, is_private_file: nil, is_published: nil, overwrite_ai_tags: nil, overwrite_custom_metadata: nil, overwrite_file: nil, overwrite_tags: nil, response_fields: nil, tags: nil, transformation: nil, use_unique_file_name: nil, webhook_url: nil, request_options: {}) ⇒ Imagekitio::Models::Beta::V2::FileUploadResponse
Some parameter documentations has been truncated, see Models::Beta::V2::FileUploadParams for more details.
The V2 API enhances security by verifying the entire payload using JWT. This API is in beta.
ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time ‘token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload.
**File size limit** \ On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files, and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files, and 2GB for videos. These limits can be further increased with higher-tier plans.
**Version limit** \ A file can have a maximum of 100 versions.
**Demo applications**
-
A full-fledged [upload widget using Uppy](github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more.
-
[Quick start guides](/docs/quick-start-guides) for various frameworks and technologies.
86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/imagekitio/resources/beta/v2/files.rb', line 86 def upload(params) parsed, = Imagekitio::Beta::V2::FileUploadParams.dump_request(params) path = @client.base_url_overridden? ? "api/v2/files/upload" : "https://upload.imagekit.io/api/v2/files/upload" @client.request( method: :post, path: path, headers: {"content-type" => "multipart/form-data"}, body: parsed, model: Imagekitio::Models::Beta::V2::FileUploadResponse, options: ) end |