Download from upload drager antd
Hi guys, I'm folllowing this guide for upload a pdf file
https://refine.dev/docs/advanced-tutorials/upload/base64-upload/#example-1
Now I want to enable download function for file I have uploaded, how can I do that, can anyone help me?
Base64 Upload | refine
By encoding your files and images from your forms to Base64 you can change all files needed for the upload to Base64 format before the submit. This can be done via the onFinish property of the `` component that comes with Ant Design
2 Replies
Hi @Tan Dep Trai So 1. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To enable the download function for the file you have uploaded, you can use the
url
property of the file object. This url
is the download URL of the file.
In the Ant Design Upload component, each file has a set of properties, including uid
(unique id), name
(file name), url
(download URL), and status
(status of the file, which can be "error", "success", "done", "uploading", or "removed").
Here is an example of a file object:
In this case, the url
property is the download URL of the file. You can use this URL to create a download link for the file.
Please note that the file object structure and properties may vary depending on the API response of your file upload endpoint.
For more information, you can refer to the Ant Design Upload component documentation (https://ant.design/components/upload) and the Refine documentation (https://refine.dev/docs/advanced-tutorials/upload/multipart-upload#create-form).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@369510721135837184> kapa.ai is still learning and improving, please let us know how it did by reacting below