Is the below code required in your logic?
byte[] fileData = new byte[file.InputStream.Length]
file.InputStream.Read(fileData, 0, (int)file.InputStream.Length)
I don't think you are using the input stream anywhere after this code.
Please comment it and try again.