Re: HttpWebRequest file upload problem

From: Joerg Jooss (joerg.jooss_at_gmx.net)
Date: 09/16/04


Date: Thu, 16 Sep 2004 10:48:07 +0200

R Reyes wrote:
> Two different web servers I have tried, here they are
>
> Here is the first on a remote web server. I think this is probably a
> permissions error and am trying to figure out exactly which ones
> because read/write are granted...
> File upload failed: System.Net.WebException: The remote server
> returned an error: (405) Method Not Allowed.
> at System.Net.HttpWebRequest.CheckFinalStatus()
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult
> asyncResult) at System.Net.HttpWebRequest.GetResponse()
> at myProject.ForumSubmit.uploadFile(String strAttachFile) in
> C:\Inetpub\wwwroot\myProject\ForumSubmit.aspx.cs:line 181

What did you try? A PUT? A POST?

> Here is the second connection which is just to another folder on my
> computer...I also have folder with read/write access so I am not sure
> why access is denied.
> File upload failed: System.UnauthorizedAccessException: Access to the
> path "C:\public\tempFiles\work\docs\myDoc_.doc" 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.IO.File.OpenRead(String path)
> at myProject.ForumSubmit.uploadFile(String strAttachFile) in
> c:\inetpub\wwwroot\myProject\forumsubmit.aspx.cs:line 170

Does the ASP.NET process have write permission for
C:\public\tempFiles\work\docs?

> I'm not sure why it's not working or why a folder needs certain
> access.

Because of security? It's not a good idea to allow exposed services like a
web server or an application server to do everything on your production
server.

> Whenever I try uploading files from my computer to any forum
> online they don't need to see my folders as having shared access. I
> just choose the file click Submit and it works fine for them. So why
> not here?

What has this to do with shared folders on your system? All you need is to
understand the security implications and configure your system accordingly.

Cheers,

-- 
Joerg Jooss
joerg.jooss@gmx.net 


Relevant Pages

  • Re: Need help setting up remote desktop.
    ... if your Web server is registered with the WINS server as ... Is there any particular reason you want to use the web based method? ... those folders, the way I can with the people who are on the home network ... however, as of this writing, I have not finished reading the instructions ...
    (microsoft.public.windowsxp.network_web)
  • Re: Integrated Windows Authorisation
    ... Challenge/Response) or Basic Authentication it depends on several ... logged on to a domain that is not trusted by your web server. ... > home area and administrators. ... >> Are you interested in restricting who can read these Web folders or are ...
    (microsoft.public.inetserver.iis.security)
  • Re: ASP.Net horrow story and questions...
    ... I turned on auditing for the workstation and web server and found no ... WebForm1.aspx) are not being created on the workstation. ... curiosity of having _vti_cnf and _vti_pvt folders as well. ... In IIS Manager on Web Server create a new Web Site ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.Net horrow story and questions...
    ... I did, however, notice that the files on the workstation are not being ... folders are being created. ... >Web Server: ... In IIS Manager on Web Server create a new Web Site ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: HttpWebRequest file upload problem
    ... switching folders from the shared folders on my computer to the unshared ... able to upload to different websites then it shouldn't have to be different ... >> Here is the first on a remote web server. ...
    (microsoft.public.dotnet.languages.csharp)