Added option to delete original file when storing it locally