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. Web Development
  3. What HTTP headers do I need to add to download CAB files?

What HTTP headers do I need to add to download CAB files?

Scheduled Pinned Locked Moved Web Development
c++htmlsysadminhelpquestion
3 Posts 2 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.
  • T Offline
    T Offline
    Terry ONolley
    wrote on last edited by
    #1

    I am getting server errors when trying to download a CAB file from a webserver. I think the problem is that the default headers don't allow for CAB file mime type. What string do I need to use in my call to CHttpFile.AddRequestheaders(); to get this file? I believe this is the problem, because if I change the URL to point to an HTML page, but leave everything else the same, then the file downloads just fine. Thanks! (I am also posting this in VC++ forum)


    //placeholder for witty verbiage

    A 1 Reply Last reply
    0
    • T Terry ONolley

      I am getting server errors when trying to download a CAB file from a webserver. I think the problem is that the default headers don't allow for CAB file mime type. What string do I need to use in my call to CHttpFile.AddRequestheaders(); to get this file? I believe this is the problem, because if I change the URL to point to an HTML page, but leave everything else the same, then the file downloads just fine. Thanks! (I am also posting this in VC++ forum)


      //placeholder for witty verbiage

      A Offline
      A Offline
      Andrew Quinn AUS
      wrote on last edited by
      #2

      Hi, I'm guessing that you need to include the header:

      Accept: application/cab

      so

      CString szHeaders = "Accept: application/cab\r\n";
      pFile->AddRequestHeaders(szHeaders);

      Hope this helps, Andy

      T 1 Reply Last reply
      0
      • A Andrew Quinn AUS

        Hi, I'm guessing that you need to include the header:

        Accept: application/cab

        so

        CString szHeaders = "Accept: application/cab\r\n";
        pFile->AddRequestHeaders(szHeaders);

        Hope this helps, Andy

        T Offline
        T Offline
        Terry ONolley
        wrote on last edited by
        #3

        Turns out I had the wrong path on my server DO'H! But the CAB file thing still has me messed up because I don't know how to get it to automatically execute. If I try to download the single EXE file contained within it, I get a server error. I tried "Accept: application/exe" for my header and my webserver throws an error. How do you form the headers for an EXE file?


        //placeholder for witty verbiage

        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