none
Getting 403 (Forbidden) error when downloading a file

    Question

  • I have a very strange problem. I have 192 customers using a program and only 1 of these customers gets a 403 (Forbidden) error when downloading an update file from our server. To make things really interesting the 1 customer who is having the problem has 3 users, 2 of which can do the update with no problem. All 3 users are behind the same firewall and have similar rights. Anyone know where I could begin looking?
    Here is a snippet of the code I am using:

    Imports System
    Imports System.IO
    Imports System.Net
    Public Class SelectStates
         Private Sub btnGetUpdates_Click(ByVal sender As System.Object, _
              ByVal e As System.EventArgs) Handles btnGetUpdates.Click
     
             Dim mywebclient As WebClient
             Dim ZipFile As String = "C:\Apppath\update.zip"
            Dim uristring As String = "http://www.woofwoof.com/Updates/username_sessionID/updatefile.zip"
      
            Try
                 mywebclient.DownloadFile(uristring, ZipFile)
            Catch ex As Exception
                'Get some information about the file
                ErrMsg = "Error downloading " & ZipFile & vbCrLf & ex.Message
                MsgBox("Error downloading " & ZipFile)
                If Logon.chkDebug.Checked Then
                        My.Computer.FileSystem.WriteAllText("debugging.txt", "ERROR downloading " & _
                             ZipFile & vbCrLf & ex.Message & vbCrLf, True)
                End If
                Exit Sub
            End Try 

    the routine dies on the mywebclient download with this error:
    ERROR downloading C:\Apppath\update.zip
    The remote server returned an error: (403) Forbidden.

    Bill
    Wednesday, December 31, 2008 4:24 PM

Answers

  • I don't know if this will help, but I recently came up against a funny problem (bug?) when I installed 2008 on a server and joined the domain.

    Next time I logged on and ran visual studio NONE of my visual studio apps would work.  I looked all over and found no solution.  The funny part was I could step through the code, but not just F5 and run it.  I'm thinking it has to to with permissions with the work group.  I got a very strange error for my database program, but the rest of my complied apps wouldn't run at all. Nor would newly developed apps.  What I ended up doing is re-installing my OS, (yeah, I know) , joining the domain, and THEN installed visual studio.  Lo and behold, that worked.  I have no solid reason why.

    Don't know if that would help, but your problem sounded kinda like mine. Lemme know what you find out.

    Sorry, I never asked, are you doing the update via code?

    Luke

    Take it easy, but take it.

    • Marked as answer by Xingwei Hu Wednesday, January 07, 2009 7:32 AM
    Wednesday, December 31, 2008 5:55 PM

All replies

  • so its only one computer? even though there are several others behind the same firewall?

    id check the settings on the computer   (on vista make sure app is running as admin)

    if all the other computers are working its probably a setting on that computer, try disabling all firewalls and trying it then.

    - learning visual basic
    Wednesday, December 31, 2008 4:41 PM
  •  Yes it is only 1 user on 1 computer. User is running Windows XP Pro so Vista is not an issue. It is a customer of mine so I really can't turn off firewalls, etc.
    Bill
    Wednesday, December 31, 2008 4:44 PM
  • I don't know if this will help, but I recently came up against a funny problem (bug?) when I installed 2008 on a server and joined the domain.

    Next time I logged on and ran visual studio NONE of my visual studio apps would work.  I looked all over and found no solution.  The funny part was I could step through the code, but not just F5 and run it.  I'm thinking it has to to with permissions with the work group.  I got a very strange error for my database program, but the rest of my complied apps wouldn't run at all. Nor would newly developed apps.  What I ended up doing is re-installing my OS, (yeah, I know) , joining the domain, and THEN installed visual studio.  Lo and behold, that worked.  I have no solid reason why.

    Don't know if that would help, but your problem sounded kinda like mine. Lemme know what you find out.

    Sorry, I never asked, are you doing the update via code?

    Luke

    Take it easy, but take it.

    • Marked as answer by Xingwei Hu Wednesday, January 07, 2009 7:32 AM
    Wednesday, December 31, 2008 5:55 PM
  • I am doing the update using code and the code works for at least 191 users every month. The user runs a program on their PC that logs onto a web service on our server and builds a file for them to download. When it is done building it the file location is returned to the PC and then the code I typed in above retrieves the file.
    Bill
    Wednesday, December 31, 2008 6:31 PM
  • just to satisfy my hunch, were any of these computers added to the domain after .net  was installed?

    these isssues may not be related, but they may be

    luke

    Take it easy, but take it.
    Wednesday, December 31, 2008 7:21 PM