Error: Not able to save file using web service
Hi,
The thing im doing is im using a web service which will take file from client and read the contents to the target path selected and saves the file in the target Path
Wen i chose any folder in the drives its working fine
but wen i choose the desctop or any drive (like C:\\) as target path its giving the following error
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\1972.GSIS\My Documents\Visual Studio 2005\sequence1.txt' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at Service.SaveDocument(Byte[] docBinArray, String sourceDocPath, String destDocPath) in c:\Inetpub\wwwroot\DocumentMangService\App_Code\Se rvice.cs:line 31
--- End of inner exception stack trace ---
Im getting same error even if i change the target path as
System.IO.Path.Combine(Server.MapPath("~/upload"),
So could any one help me out.
|