Reverted file upload method
Cleaned up code