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