a better script for uploading files