none
webclient.downloadfile returns forbidden RRS feed

  • Question

  • Windows 7 64-bit, VS 2010

    Downloading collection of DLLs and an application.exe using WebClient.DownloadFile(uri, name) without any problems. When I try to download the application.exe.config file, I get a 403, forbidden.

    Checked all the security and access settings, they are the same for all the files.

    Any ideas about why and how to workaround this will be greatly appreciated.

    Thanks,

    RK

    Monday, February 23, 2015 8:02 PM

Answers

All replies

  • Hi RK,

    So it is the web development issue, am I right?

    If so, the ASP.NET forum would be better for this issue.

    http://forums.asp.net

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 26, 2015 10:19 AM
  • Not really a web issue. Everything is Win Forms and the .Net download client is just trying to pull the files down to target computer. The connection is to a download site that is just a folder on the support computer. This is accessed from a running Win Forms program that detects a new version of the program and pulls it down.

    I have made a crude workaround by changing the .config file name to .txt and renaming it back to .config after the download is finished. It does work, but I would rather the .config file downloaded cleanly.

    Thanks for the response.

    RK

    Friday, March 6, 2015 11:56 PM
  • This one may help.

    "app.exe.config is restricted by security considerations to read-only for most applications."

    https://msdn.microsoft.com/en-us/library/8eyb2ct1%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    Winforms forum is here.

    https://social.msdn.microsoft.com/Forums/windows/en-US/home?forum=winforms

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Saturday, March 7, 2015 12:36 AM
    Moderator
  • Thanks for the help. The fact that config files are limited to read only implies that the WebClient.DownloadFile() opens the file for read/write instead of read only. I wonder why.

    We have problems with the config file changing with new versions of .Net. The application has been around for many years and the older installations still point to .Net 2. Our new 64 bit Win 7 desktop computers choke on that: they want .Net 4 in the config file.

    As I said, I really don't like my clumsy workaround. Are there any other ideas out there?

    Thanks,

    RK

    Monday, March 9, 2015 3:03 PM
  • If you're thinking it dotnet framework related then I'd try over here.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=clr%2Cdotnetnative%2Cnetfxbcl%2Cnetfxsetup&filter=alltypes&sort=lastpostdesc

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Tuesday, March 10, 2015 12:34 AM
    Moderator