 |
|
 |
Can someone help me figure out how to convert the code to use POST instead of GET?
In some cases where I'm pushing data I will be exceeding the 2k limit on GET requests.
|
|
|
|
 |
|
 |
I tried to save a jpeg from a link. The string gives me 4 bytes. What might be the problem?
|
|
|
|
 |
|
 |
Hi
I want to do the same but in a portable code, non-MFC. Can it be done? I found a "curl" and "curlpp" library on the net, but the documentation is extremely poor.. you want to kill yourself trying to compile or use this curlpp library.
Any painless method to grab url without MFC? Thanks.
Mat
|
|
|
|
 |
|
 |
Hi,
this class is very useful so far, and I have been able to use it. So as long as you know the html address of the page to download. My question is, some web pages have embeded menus that allows you to select some options, say an "advanced search" option, then when clicking "go" (or whatever action button), it would generate a web page, but the address is not specific and still shows the 'home' address. Is there a way to grab such web page content? perhaps if we can send the button command, including the options that the form would be asking, and grab the web page result, that would be awesome.
An example can be seen using the Wall Street Journal web site, on the search section:
http://online.wsj.com/search/term.html?KEYWORDS=
you can search articles, but the result html page shows always the same address.. so there is no way to grab that page without knowing the result page address..
Thanks for your inputs!
Mat
|
|
|
|
 |
|
 |
I have only one question,
Where are downloaded files?
Thanks!!!
|
|
|
|
 |
|
 |
what type of files can i download with this is application ?
can i down download kml and svs files ?
|
|
|
|
 |
|
 |
Is there an easy way to write a data file to
the net (assuming you have the login and passcode
for that website)? If so, any chance you can show
me an example or what code I would add to this
class to make it write as well?
Please, any response you can give me will be
greatly appreciated.
Sincerely,
Danielle Brina
|
|
|
|
 |
|
 |
Hello,
When I navgate to a URL from the browser the download starts, but when I use your sample I get a message that says Incorrect Access Permission your broweser must not be accepting cookies.
Any idea why I can initiate the download from the browser, but not from WebGrab?
Any help would be greatly appreciated.
Thanks,
Tony
|
|
|
|
 |
|
 |
Great class but I need to be able to retrieve files from SSL (https) sites, some of which have self-signed certificates. I added a SetOption() to ignore certificate problems:
m_pSession->SetOption(INTERNET_OPTION_SECURITY_FLAGS,SECURITY_FLAG_IGNORE_UNKNOWN_CA);
And then I modified the OpenURL function to include INTERNET_FLAG_SECURE for https:
pFile = (CHttpFile*) m_pSession->OpenURL(szURL, 1,
INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_SECURE);
This all seemed reasonable but the first problem is that SetOption returns a 12018 (supplied handle is of wrong type...). I found a link somewhere, maybe valid or maybe folklore that stated you had to call OpenURL() first and let it fail and then in the exception handler, call SetOption and call OpenURL() again. Tried that and SetOption still fails with 12018.
Any ideas or suggestions would be greatly appreaciated!
Thanks,
Doug
Doug Knudson
|
|
|
|
 |
|
 |
Hello
I was find in Internet how download a file of net ..
because I need to download this file .. prod_csv.zip
this is URL https://quoll.ogc.gov.bc.ca/download/prod_csv.zip
[^]">
I don't know How I do it
please ..
I need your help ....
|
|
|
|
 |
|
 |
I'm working with Visual C++ 6.0 and I don't know how to set the project to make this work, or even if It's possible to make it work. Some help?
solvet, just change settings :-P
-- modified at 17:04 Friday 16th February, 2007
My problem now is to download somethink that is no a text, like a jpg image.
|
|
|
|
 |
|
 |
You can also pass a jpg url. It still ends up in a string array so you probably don't want to render it in the window.
Actually I hacked the code a little bit that it takes a FILE pointer as argument instead of a string and I write to a file. Pretty trivial.
I found one issue with the current string implementation and that is that the download speed goes down as the file is longer. When downloading a 25M file, I started with a speed of about 150 kbyte/s and ended around 85 kbyte/s.
This is due to the string concatenation of new packets.
When I started using files, the speed of 150k was kept until the end.
Frans.
|
|
|
|
 |
|
 |
Odd.
I needed something like this, downloaded the demo project and gave it a try (out of the box)
The odd thing is that we have a proxy server (without login or password) and I just get the file.
????
|
|
|
|
 |
|
 |
I had problems getting through my proxy server (also without login/password). So, i made the Initialise() function just grab the proxy settings from Internet Explorer (added the flag 'm_useProxySettingsFromIE'), and now it works:
BOOL CWebGrab::Initialise(LPCTSTR szAgentName /*=NULL*/, CWnd* pWnd /*=NULL*/)
{
Close();
m_infoStatusCode=0;
m_pSession = new CWebGrabSession(szAgentName, pWnd);
if (m_timeOut != 0)
m_pSession->SetOption(INTERNET_OPTION_DATA_RECEIVE_TIMEOUT ,m_timeOut);
// added Bryce
if (m_useProxy)
{
INTERNET_PROXY_INFO proxyinfo;
unsigned long proxyinfoSize = sizeof(proxyinfo);
if (m_useProxySettingsFromIE) {
if (!InternetQueryOption(NULL, INTERNET_OPTION_PROXY, &proxyinfo, &proxyinfoSize)) {
printf("InternetQueryOption failed! LastError=%d\n", GetLastError());
exit(-1);
}
} else {
char buf[10];
_itoa_s(m_Port,buf,10);
CString temp = m_Proxy+(CString)":"+(CString)buf;
proxyinfo.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
proxyinfo.lpszProxy = temp;
proxyinfo.lpszProxyBypass = NULL;
}
m_pSession->SetOption(INTERNET_OPTION_PROXY, (LPVOID)&proxyinfo, proxyinfoSize);
}
return (m_pSession != NULL);
}
|
|
|
|
 |
|
|
 |
|
 |
Class make wrong buffer size due to unsupported unicode.
|
|
|
|
 |
|
 |
For UNICODE support you must do a conversion:
char buf[10];
_itoa_s(m_Port,buf,10);
CString temp = m_Proxy+(CString)":"+(CString)buf;
LPSTR lpsz = new char[temp.GetLength()+1];
WideCharToMultiByte(CP_ACP, // ANSI Code Page
0, // no flags
temp, // source widechar string
-1, // assume NUL-terminated
lpsz, // target buffer
temp.GetLength()+1, // target buffer length
NULL, // use system default char
NULL); // don't care if default used
proxyinfo.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
proxyinfo.lpszProxy = (LPCTSTR)lpsz;
proxyinfo.lpszProxyBypass = NULL;
|
|
|
|
 |
|
 |
Hi
I have added the following code in the CWebGrab::Initialise() function for the proxy authentication after the INTERNET_OPTION_PROXY setoption call
BOOL bRet;
m_pSession->SetOption(INTERNET_OPTION_PROXY, (LPVOID)&proxyinfo, sizeof(INTERNET_PROXY_INFO));
DWORD size = (strlen(strUserName));
bRet = m_pSession->SetOption(INTERNET_OPTION_PROXY_USERNAME,strUserName.GetBuffer(strUserName.GetLength()),strUserName.GetLength());
if(!bRet)
{
CString str;
DWORD err = 0;
err = GetLastError();
str.Format("User Error %d",err);
AfxMessageBox(str);
}
bRet = m_pSession->SetOption(INTERNET_OPTION_PROXY_PASSWORD,strPassword.GetBuffer(strPassword.GetLength()),strPassword.GetLength());
if(!bRet)
{
CString str;
DWORD err = GetLastError();
str.Format("Pass Error %d",err);
AfxMessageBox(str);
}
Both the SetOption calls failed with the error code 12018 which i searched in the error lookup as a invalid message have anyone tried the proxy authentication???
Thanks
Srivathsan A
|
|
|
|
 |
|
 |
To support https,add the following code in GetFile
if (m_bForceReload) {
dwFlags |= INTERNET_FLAG_RELOAD;
}
//New Code
CString t = szURL;
if(t.Find("https")>-1)
{
dwFlags |= INTERNET_FLAG_SECURE;
}
|
|
|
|
 |
|
 |
inside CWebGrab::GetFile(...
try {
UINT nRead = 0;
dwCount = 0;
do
{....
catch (CFileException *e)
{
...
}
you must catch CInternetException
otherwise it will crash in some circumstances...
greatz
|
|
|
|
 |
|
 |
When I tried to download the following URL, it went into slepp and didn't return.
Why the connect timout is not working there ?
URL:
http://objective.mine.nu/latest.rss
Ajay
|
|
|
|
 |
|
 |
I would like to ask have to handle setting timeout,
becasue your method SetTimeout doesn't work. Please,
help me.
|
|
|
|
 |
|
 |
i try to use webgrab in emmbeded visual c++ 3.0 for pocket PC, but linker show 3 fatal error LNK2019.
i only include webgrab.h
CMy04Dlg::CMy04Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CMy04Dlg::IDD, pParent)
{
mainWnd=pParent;
}
and button contain:
CString strBuffer;
CWebGrab grab;
grab.
if (grab.GetFile(_T("http://iplato.wz.cz/get.php?&test=giveme"), // the url
strBuffer, // buffer for data
_T(""), // agent name
mainWnd // Plain ol' CStatic window
)
)
{
TRACE0("everything went OK\n");
}
these look fine but can't compile
where i make error.
i try to send some data into PHP script, and trying to receive result.
|
|
|
|
 |
|
 |
hi
on getfile function on line 224 change catch (CFileException *e) to catch (CInternetException *e)
this will avoid some execptions that will ocure on some sitations for example if u get disconneceted when you are downloading a file that exeption will not catch and that program will crash with an error message!
thanx and bye
|
|
|
|
 |
|
 |
How do i send and retrieve Cookies?
|
|
|
|
 |