-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to link each uploaded files with an other model by forgnekey or Abstract model? #62
Comments
Hi @c0d33py, you asked:
When you drop a file onto the filepond user interface in your client (or when you click and select a file in the file chooser), the file is, by default, uploaded immediately and a I know it's possible to turn off this immediate upload functionality in the filepond client, so that you have to trigger the form submission (e.g. by clicking a submit button) to upload the files - have you disabled immediate upload so that the files are only sent to the server when you click the submit button on your form? Using the normal behaviour with immediate upload enabled, you would then subsequently submit your form after the files have already been uploaded and only the temporary upload IDs (+ any additional custom form content you've added) will be submitted to the server. On the server side, you then get the list of IDs for the temporary uploads, e.g.:
...then you would move the original temporary uploads to stored uploads using something like this...
The call to You can see an example of this with the advanced version of the tutorial. The corresponding server-side implementation is shown in this I hope I have correctly understood your question and that this helps but let me know if this is not clear and you're still having an issue with this. |
First of all thanks @jcohen02 your reply! let me clear my question. I don't want to turn off immediate upload functionality!
|
Thanks for the further clarification. I think I understand the issue and can see a couple of different ways to resolve this... Here's my understanding so far: You have a So, a user fills in the form on the web page and uploads one or more files. When the user adds the files, they are uploaded immediately and stored on the server side as When the form is submitted, the There is an issue here with the need to modify
More generally, I think a better solution that would save you from having to modify I hope this helps you to resolve your issue but do let me know if you're still having a problem with this. Thanks for using django-drf-filepond. |
Thanks a lot @jcohen02! This is what i want to do. |
Hello There,
I want to know how can i link each uploaded file with an post model like each post has multiple files(photos/videos). When the user click submit button the post is created and Each file get's uploaded along with it? In my case when the user click submit button The post is created but the files which are uploaded by the user are not getting post along with it. Would you like to guide me about working of function mantioned above? And do the needfull.
models.py
views.py
The text was updated successfully, but these errors were encountered: