I think putting them in the temporary file system until submitted is a good solution. The way it works (or doesn't) right now is a problem for me, because I have a view that shows files in a certain private files directory for submitted items, but it's also showing files for items that were not submitted, since they are put in the same directory even before/without submitting the form.
- π¨π¦Canada endless_wander
For what it's worth, my experience of this issue is via Webforms with "drafts" enabled and it can cause instances where if a user accidentally uploads the wrong file, that file stays on the website. Users could upload and have uploaded sensitive files by accident that website admins are not supposed to see -- financial records, for example. They click on "Remove" and would expect that the file would be deleted entirely from the system but it does not get removed. See https://www.drupal.org/project/webform/issues/3281450 π If drafts enabled, files uploaded to a submission are never deleted even if user explicitly "removes" them Closed: duplicate
I think it should also be noted that the filename "incrementing" isn't a bug or problem in itself. If you use revisions on nodes or other content, anytime a file is updated, the old file remains behind the scenes to preserve the prior revision, and the new filename will have a number added/incremented.
Does anyone else or a maintainer have any ideas on which direction a solution attempt should go? The issue summary suggests a few different methods.
- π¬π§United Kingdom mcdruid π¬π§πͺπΊ
If I understand correctly, the main issue being discussed here would be addressed by implementing this:
β¨ Allow files on un-saved submissions to be stored in temporary file scheme. Needs work
...in Drupal core.
One significant problem with that is there isn't really (yet) a single shared file upload functionality in core where this could be applied.
The reasons for that are outlined in detail here:
π [META] Modernise file upload logic Active
...along with plans and proposals for improving core file upload handling overall.
If we wanted to suggest that "file uploads should be stored in temporary:// until they are ready to be moved to a permanent location" I think the META to modernise the upload logic would probably be the right place to bring that up.