Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. HttpWebRequest fails where WinINet functions succeed

HttpWebRequest fails where WinINet functions succeed

Scheduled Pinned Locked Moved C#
questionsharepointsysadminsecuritytesting
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cheesepirate
    wrote on last edited by
    #1

    I have an app which communicates with a SharePoint server, and one of the things it does is uploads files to the SharePoint server using a HttpWebRequest. However I have found that this doesn't work when the file being uploaded is bigger than about 2mb and either of the following conditions apply - The user is at home and is using VPN to connect to the newtwork - The server is hosted on an ordinary broadband connection The request throws an exception saying 401, unauthorized. Using Fiddler to examine the http request going back and forth, I found that the exception is somewhat incorrect, and is actually referring to the first request of a pair (the first doesn't supply username/password, server asks for authorization, the second supplies the username/password). What has actually happened is that the server has just closed the connection and no reason is supplied as far as I can tell. It *might* even be a gateway timeout, but I very rarely even get a reply from the server under these conditions Using a Win32 app I have for testing things like this, I found that WinINet has no problems putting the file onto the server. I'm a little baffled as to what is happening here. Has anyone else had something like this or have any solutions? Dave

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups