unwilling-turquoise
unwilling-turquoise2d ago

Uploading file in strapi specific folder

How do I upload a file in a specific folder in strapi v4 media upload using upload in antd
2 Replies
kapa.ai
kapa.ai2d ago
Hi @bogdand2011. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources do not contain explicit information about how to upload a file to a specific folder in Strapi v4 using the Ant Design (antd) Upload component with Refine. The provided examples show how to upload files to Strapi using the default upload endpoint and how to integrate with Ant Design forms, but they do not cover specifying a target folder for uploads in Strapi v4. The typical usage shown is:
<Upload.Dragger
name="files"
action={`${API_URL}/api/upload`}
headers={{
Authorization: `Bearer ${localStorage.getItem(TOKEN_KEY)}`,
}}
listType="picture"
multiple
>
<p className="ant-upload-text">Drag & drop a file in this area</p>
</Upload.Dragger>
<Upload.Dragger
name="files"
action={`${API_URL}/api/upload`}
headers={{
Authorization: `Bearer ${localStorage.getItem(TOKEN_KEY)}`,
}}
listType="picture"
multiple
>
<p className="ant-upload-text">Drag & drop a file in this area</p>
</Upload.Dragger>
However, there is no mention of how to set a folder or directory for the uploaded file in the request or via the Strapi API in the documentation or examples provided. You may need to consult the official Strapi documentation or community for this specific use case, as it is not covered in the Refine documentation or examples available here File Upload with Strapi v4. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2d ago
<@1050096218518339645> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?