Free Support Forum -

Could not find part of the path


I am attempting to save a Aspose.Words document created by my website to a mapped Novell network drive and I keep getting the error message:

Could not find part of the path 'U:\mynetworkfolder\mydocument.doc'

U: is the mapped drive letter of the Novell drive I am trying to save my document to. The web server is logged on to the Novell network and it can definitely see the mapped U: drive. It shows up in the list of mapped drives in the My Computer window.

But whether I run the web site locally on the web server or from a client computer, whenever it tries to save the document, I get the error message.

The code I'm using to do this is:

Dim doc As Document = New Document("document1.doc") <== document1.doc resides locally on web site




--- insert some text at bookmarks




doc.Save("U:\mynetworkfolder\mydocument.doc", SaveFormat.Doc)

The actual error I receive is:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'U:\mynetworkfolder\mydocument.doc'.

Source Error:

Line 62:
Line 63:             doc.Save("U:\mynetworkfolder\mydocument.doc", SaveFormat.Doc)
Line 64:             doc.Save(strFileKey & ".doc", SaveFormat.Doc, SaveType.OpenInBrowser, Response)
Line 65: 

Source File: c:\inetpub\wwwroot\mywebsite\word_templates\word_popup.aspx.vb Line: 63

Stack Trace:

[DirectoryNotFoundException: Could not find a part of the path 'U:\mynetworkfolder\mydocument.doc'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1971376
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +998
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +115
   Aspose.Words.Document.Save(String fileName, SaveFormat fileFormat) +173
   word_popup.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\mywebsite\word_templates\word_popup.aspx.vb:63
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

Any help you can give would be most appreciated!

Thanks very much!


Thanks for your inquiry. I don’t think that this is problem of Aspose.Words. Could you write something on this drive? For example try using the following code.

Stream file = new FileStream(@"U:\mynetworkfolder\test.txt", FileMode.Create);

StreamWriter writer = new StreamWriter(file);




Maybe you can find solution here.

Best regards.

Hi Alexey,

Thanks again for the quick response. You are right, it is not a problem of Aspose.Words. I tried the code you suggested and got the same error message. Thanks for the link. It led me to a site where I downloaded a class module to add to my web application that allows the web application to map its own network drive. After including this in my web application, I found that it did not map the drive, so when I went to write a file to it using the code you gave me, I again got the error.

On another discussion thread, I found a suggestion that it may have to do with the security on the .NET web server and my web application not having the security rights to allow it to map a network drive. It suggests that I modify the assembly\user access rights on the web server under "Control Panel\Administrative Tools\Microsoft .NET Framework x.x Configuration".

Being somewhat of a beginner when it comes to .NET, I am currently researching how to do this.

Thanks so much for your help. Even though it wasn't a problem with Aspose.Words, you still provided me with help and for that I am truly grateful!