allow saving files with no content or local file set yet. autosave up on file upload
Here is a possible fix the issue I described here.
In the hook_file_before_save function, it checks to see if a local file exists by seeing if file_url is set or not. If it's not set, and it's a new file, then it just does nothing. But this lets the file be saved without any content, allowing a name to be set. Then in the upload function, if the name is not set, it will call save. This no longer results in recursion as the hook will not call the upload function now.
I did a bit of testing, but I imagine you have more tests you can run? I know it's kind of a central component being changed. It does allow my problem test case to work though.
just fixed a typo in the first commit of this pull request that broke things. Somehow "s3" got changed to "s4".