How does the backend know where to place a file once its sent #218
-
|
How does the backend know where to place a file once its sent? im using django and when i receive the request object containing the file data, theres nothing about the file path. i notice on the example backend there is an expected parentId, but i dont see that when the request hits my api, and im not seeing anywhere it was added manually. anything would help, thank you so much |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
@mohannadwahmad17 The backend relies on The const handleFileUploading = (file, parentFolder) => {
return { parentId: parentFolder?._id };
};
This ensures that every upload request includes the folder reference. On the backend (Django, in your case), you can then read I should’ve made this clearer in the documentation — thanks for pointing it out! |
Beta Was this translation helpful? Give feedback.
@mohannadwahmad17 The backend relies on
parentIdto know which folder the file should be placed into. By default, the request only includes the file data itself — it won’t automatically include any folder context. That’s why you need to explicitly attach theparentIdwhen uploading.The
FileManagercomponent provides a callback you can use to customize what metadata gets sent with the file upload request. In your case, you’ll want to send theparentIdof the folder where the file should go. Whatever object you return in this callback will be appended to the file upload request in theFormData.