Skip to content

Commit a7b12db

Browse files
Manu ChaudharyManu Chaudhary
authored andcommitted
readme update
1 parent 41f56be commit a7b12db

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,28 +232,30 @@ transformation code from ImageKit docs as the name when using in the ```url``` f
232232

233233
## File Upload
234234

235-
The SDK provides a simple interface using the `.upload()` method to upload files to the ImageKit Media library. It
235+
The SDK provides a simple interface using the `.upload_file()` method to upload files to the ImageKit Media library. It
236236
accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload).
237237

238-
The `upload()` method requires at least the `file` and the `file_name` parameter to upload a file. You can pass other parameters supported by the ImageKit upload API using the same parameter name as specified in the upload API documentation. For example, to
239-
specify tags for a file at the time of upload use the tags parameter as specified in the
240-
[documentation here](https://docs.imagekit.io/media-library/overview/image-tags)
241-
238+
The `upload_file()` method requires at least the `file` and the `file_name` parameter to upload a file and returns a Dict with error or success data. Use `options` parameter to pass other parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload). Use the same parameter name as specified in the upload API documentation.
242239

243240
Simple usage
244241

245242
```python
246-
imagekit.file_upload(
247-
file = "<url|base_64|binary>", # required
243+
imagekit.upload_file(
244+
file= "<url|base_64|binary>", # required
248245
file_name= "my_file_name.jpg", # required
249-
folder : "/example-folder/",
250-
tags: ["sample-tag"]
246+
options= {
247+
"folder" : "/example-folder/",
248+
"tags": ["sample-tag"],
249+
"is_private_file": False,
250+
"use_unique_file_name": True,
251+
"response_fields": ["is_private_file", "tags"],
252+
}
251253
)
252254

253255
```
254256

255257
If the upload succeed, `error` will be `null` and the `result` will be the same as what is received from ImageKit's servers.
256-
If the upload fails, `error` will be the same as what is received from ImageKit's servers and the `result` will be null.
258+
If the upload fails, `error` will be the same as what is received from ImageKit's servers and the `result` will be null. Learn more from the sample app in this repository.
257259

258260
## File Management
259261

0 commit comments

Comments
 (0)