A: 

Two things:

  1. Make sure you dispose the stream (see this post)
  2. Have you tried taking the file.length from the stream?

Alternatively just use the following code (from the top of my head)

byte[] content = file.OpenBinary();
Muhimbi
Thnak u Muhimbi, But i tried that too. Its not working. I am getting the same issue
barathan
How to overcome this issue? Please help me
barathan
Don't know, other than what I recommended. Try stepping through your code and see if your variables contain sensible information during every step.
Muhimbi
A: 

Try checking out the file prior to opening. Also dispose of the stream as mentioned above.

ChiliYago