Editor File Upload
Editor File Upload
Orayi
Posts: 6Questions: 1Answers: 0
I have managed to get the file upload to upload the temporary file but I seem to be having issues after that.
When the form is submitted it's not post any data.
This only happens in forms with a file upload control, if there isn't one it works fine.
Any ideas what I might be doing wrong?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Might be a Laravel issue.
Seems to work fine if I use different functions for upload and submit.
On a side note, I've noticed that the files array doesn't get posted with the form unless I do the following:
What code are you using for the file upload? I'm not particularly familiar with Laravel, so I'm not sure how much help I will be able to offer there.
Allan
A function within my controller that uploads the file to a temporary folder.
It's all working fine now. I don't think laravel likes posting to the same function twice.
Should files be automatically appended to the post data?
At what point? When the file is selected it should be uploaded at that point as part of a multi-part upload.
Allan
Guess I'm doing it a bit different to expected.
Due to foreign key constraints and required data I can't create the record when the file is uploaded.
What I have done is all working it would just be handy if the array of uploaded files and their details was posted with the other fields when creating a new record.
Thanks for the clarification. Yes, the pre-built libraries will not obtain the file information at the point of committing the new or updated row. You would need to modify the server-side code to return that information and likely update the client-side with that additional information. It is stored in
$.fn.dataTable.Editor.files
.Allan
Thanks for the help, I guess that appending it client side is the best option for me as I've done above.