You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using FileField in the cms is not possible because files are not submitted due to how the form is submitted through ajax.
This is an issue because it means it's not always practical to "send files" not meant to be saved as assets, but for example as import templates or whatever.
Thanks for reporting this. FileField is a weird one - in the past I've given up and made my own complex uploading nonsense based around how UploadField works so it'd be nice to see this fixed.
This should be really easy to fix, I'm happy to give it a try
Module version(s) affected
4.x, 5.x
Description
Using FileField in the cms is not possible because files are not submitted due to how the form is submitted through ajax.
This is an issue because it means it's not always practical to "send files" not meant to be saved as assets, but for example as import templates or whatever.
Issue for reference:
lekoala/silverstripe-pure-modal#8
How to reproduce
Have a model admin instance and a model
Have this
Select a file, click save and close, and see how $_FILES is empty
Possible Solution
i believe it's due to how the form is submitted by LeftAndMain see here
silverstripe-admin/client/src/legacy/LeftAndMain.js
Lines 539 to 546 in 0517656
it should really be replaced by a simple FormData that should work fine instead
https://stackoverflow.com/questions/41684385/how-to-add-file-value-with-jquery-serialize
This should be really easy to fix, I'm happy to give it a try
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs
The text was updated successfully, but these errors were encountered: