Skip to content

Commit 93a3566

Browse files
authored
ref: add a new topic on readme about signed url
1 parent db34e53 commit 93a3566

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,22 @@ Please note, however, that **custom URLs will not work with AWS_S3_PUBLIC_URL**
216216
URL doesn't accept extra parameters, and it will raise ``ValueError``.
217217

218218

219+
Presigned URL
220+
-----------
221+
Pre-signed URLs allow temporary access to S3 objects without AWS credentials.
222+
Generate a URL with permissions and time limit, then provide it to the user for downloading or uploading the object.
223+
API server does not need to handle the I/O of transferring the file, which can be resource-intensive and slow down the server's response time.
224+
Instead, the user can directly interact with S3, improving performance and reducing the load on your API server.
225+
It's secure and flexible for temporary access to S3 objects.
226+
227+
For download a existed file:
228+
.. code:: python
229+
url = storage.url("foo/bar.pdf")
230+
231+
For upload new file:
232+
.. code:: python
233+
url = storage.url("foo/bar.pdf", clientMethod="put_object")
234+
219235
Management commands
220236
-------------------
221237

0 commit comments

Comments
 (0)