I am trying to upload a file from the web client and I get an access
is denied msg. People can access this folder through network so I am
confused why I am getting an error. Any help would be appreciated.
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient()
Response.Write(ControlChars.Cr + "Please enter the URL to post data to : ")
Dim uriString As String = "\\192.168.1.56\vctemp"
Response.Write(ControlChars.Cr + "Please enter the fully qualified path of
the file to be uploaded to the URL")
Dim fileName As String = "c:\config.txt"
' Upload the file to the Url using the HTTP 1.0 POST.
Dim responseArray As Byte() = myWebClient.UploadFile(uriString, "POST",
fileName)
Hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"John Ashbaugh" <jash...@hotmail.com> wrote in message
news:#JS1L$uSCHA.4260@tkmsftngp09...
The aspnet account has administrator rights(I know this isn't a good
setup, but it's all on my local computer and testing only) If I try to use a
network drive it gives me the bad password or login. Where can I setup the
login as password for aspnet to use for hopefully get any of this resolved?
The \\192.168.1.56\vctemp folder is a folder that I setup as shared. People
can map the drive from their computers as well. Thanks in advance.
"Steve C. Orr, MCSD" <st...@orr.net> wrote in message
news:O34j9avSCHA.4168@tkmsftngp08...
What you need to do is to go to the folder in your web applcation in which
you are trying to save the files. Then in the -->properties-->security, add
aspnet user of ur machine to it and give him full rights ... i.e. read /
write ...
It should work after that.
Regards,
Vijit
"John Ashbaugh" <jash...@hotmail.com> wrote in message
news:#q5KZlvSCHA.1496@tkmsftngp11...
Yes I saw that on the asp error however I do not have a security tab
anywhere on the folder. I am using xp pro and am hosting everything on one
computer. So I went to users and modified the aspnet_wp account and get it
admin rights. Am I missing something else?
"vijit chhabra" <vijit_...@hotmail.com> wrote in message
news:eilynoySCHA.2272@tkmsftngp11...
Yes confusing isn't it? You have to go to the folder options and turn off
simple file sharing. Then all the standard permissions tabs turn up again.
It's a standard case of MS simplifying things and in the process making them
even more complicated.
If you've assigned Admin rights to your ASP.NET user it may be that these
rights won't take effect until you restart. Applying permissions to folders
is instant.
Best Wishes
Jos
----------------------------------------------------------------------
jos vernon
http://www.websupergoo.com
.NET Image Components & Consultancy
----------------------------------------------------------------------
<WebMethod()> Public Function GetFile()
Dim myWebClient As New System.Net.WebClient()
Dim uriString As String = \\192.168.1.56\test
Dim fileName As String = "c:\config.txt"
Dim responseArray As Byte() = myWebClient.UploadFile(uriString, "POST",
fileName)
End Function
"Jos Vernon" <jos_N...@websupergoo.com> wrote in message
news:eoCQdFNTCHA.3620@tkmsftngp08...
"John Ashbaugh" <jash...@hotmail.com> wrote in message
news:OAA2ZWUTCHA.1988@tkmsftngp09...
System.Net.WebException: Access to the path "\\192.168.1.56\test" is
denied. ---> System.UnauthorizedAccessException: Access to the path
"\\192.168.1.56\test" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at System.Net.FileWebStream..ctor(FileWebRequest request, String path,
FileMode mode, FileAccess access, FileShare sharing)
at System.Net.FileWebRequest.InternalGetRequestStream()
--- End of inner exception stack trace ---
Server stack trace:
at System.Net.FileWebRequest.InternalGetRequestStream()
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(Met
hodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMess
age msg, IMessageSink replySink)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message
reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed,
MessageData& msgData)
at System.Net.AsyncGetRequestStream.EndInvoke(IAsyncResult result)
at System.Net.FileWebRequest.EndGetRequestStream(IAsyncResult
asyncResult)
at System.Net.FileWebRequest.GetRequestStream()
at System.Net.WebClient.UploadFile(String address, String method, String
fileName)
at System.Net.WebClient.UploadFile(String address, String fileName)
at VcNetService.VcNetService.GetFile() in
C:\Inetpub\wwwroot\VcNetService\VcNetService.asmx.vb:line 101
"William LaMartin" <lama...@tampabay.rr.com> wrote in message
news:O6U8tUgTCHA.1948@tkmsftngp12...
It appears that your path is \\192.168.1.56\test. The path for my uploads
is something like c:\inetpub\wwwroot\WebApplication\uploads.
"John Ashbaugh" <jash...@hotmail.com> wrote in message
news:eA3EoogTCHA.4044@tkmsftngp12...