#552066 by quicksketch and pwolanin: Fix bug with file_save_upload() and trailing slashes (with tests).