You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,28 +232,30 @@ transformation code from ImageKit docs as the name when using in the ```url``` f
232
232
233
233
## File Upload
234
234
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
236
236
accepts all the parameters supported by the [ImageKit Upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload).
237
237
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
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.
242
239
243
240
Simple usage
244
241
245
242
```python
246
-
imagekit.file_upload(
247
-
file="<url|base_64|binary>", # required
243
+
imagekit.upload_file(
244
+
file="<url|base_64|binary>", # required
248
245
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
+
}
251
253
)
252
254
253
255
```
254
256
255
257
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.
0 commit comments