0

So I'm using WebClient to upload a file to a server. It works great except for one problem. If the file is opened by another program then it will not upload. For instance, if it's a word document that's been saved but is still opened by word then it fails to upload. Is there a way to force it to read whatever is there and upload it?

Chris
  • 235
  • 2
  • 14
  • Sounds like [how do you read a file which is in use](http://stackoverflow.com/questions/3709104/how-do-you-read-a-file-which-is-in-use) – Michael Feb 08 '16 at 20:02

1 Answers1

0

If i understand your question right then you can use this solution to test if the file is open and then close it if it is. It's a useful helper class i've used in the past.

https://stackoverflow.com/a/1247326/4612655

Community
  • 1
  • 1
Justin A
  • 364
  • 4
  • 14