Cleanup filenames and filepaths, set upload permissions