implementing logic for file path moving, uploading to database, and redirecting browser to index.