Added JSON method for file uploads.