What are the steps required to reproduce the bug?
Create a new content type and add a new file upload type field
Go to ADD CONTENT for your content type and attach a file and hit the UPLOAD button. Now go to a new web page or click on some other link - do NOT click on the SAVE button. Now your unnecessary file is saved on the Drupal server's storage location and makes it cluttered.
What behavior were you expecting?
If a user backs out and does not save or update the content type, then the file should not be saved in a permanent space on the file system to prevent cluttering.
What happened instead?
The (temporary) file upload stays on the file system in the production location, thus causing clutter forever.
Comments
Comment #1
berdirIt doesn't stay there forever. It is flagged as temporary in file_managed, those files are then later deleted during cron in system_cron().
That's the only way this can work, there is no way to detect an aborted node creation.
Comment #2
earwax commentedGot it, thanks! This makes sense and leaves a clean file system at a later point.
Comment #2.0
earwax commentedclarifying storage location, not the client's hard drive