how to upload the document when i open it

Answered how to upload the document when i open it

  • Freitag, 8. Juni 2012 08:20
     
      Enthält Code

    Hi, 

    I want to achieve the target is that the document can a upload itself to a server. But when i used this code, it said that Being used by another process, so the process can not access this file.

    FileStream stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read);

    Is there any way  i read it to a FileStream?

    Thank you!

Alle Antworten

  • Samstag, 9. Juni 2012 21:28
     
     Beantwortet

    Hi Tao636,

    What's document you opened? As far as I know that Office suite (such as Excel, Word or PowerPoint) will not allow other program access the file when them open the specific file. And If you want to upload them to a server, you need close the document before you update it.

    Best Regards,

    T.X. 

    • Als Antwort markiert Tao636 Montag, 11. Juni 2012 01:41
    •  
  • Montag, 11. Juni 2012 01:39
     
     

    Hi,T.X. 

     Thank you for your reply! It seems that I have no way but close it when I upload it.

     Thank you again!

    Kong