file_directory_path() was added.added the ability to save local files to a FileField, and as a security measure, a check with
However, if an importer wants to download a file and save it directly to a FileField, it makes more sense to save it to a temporary directory instead of persistent storage like the files directory.
The use case for this is e-mail attachments with Mailhandler 2.x: there are no remote URLs for attachments, and the file data exists within the message itself. Rather than saving e-mail attachments into a public folder without context, it makes more sense to be able to save a file in temp, add it to a FileField (which may benefit from permissions), and delete the temporary file.
Attached is a patch that checks file_directory_temp() in addition to