Upload and Write to file