Added code for reading from uploaded file