wininet

Why does GetErrorMessage return "wrong password", when the user name is wrong?

GetErrorMessage (from CInternetException) gives me the following: With the incorrect ftp server name: "ERROR! The server name or address could not be resolved" With the incorrect password: ERROR! The password was not allowed With the incorrect user name: ERROR! The password was not allowed <-----? NO separate message for incorrec...

Why does GetLastError() (NOT GetReturnMessage) return “wrong password”, when the user name is wrong?

Possible Duplicate: Why does GetErrorMessage return wrong password, when the user name is wrong? Since GetErrorMessage gave the same string for invalid password and username, I decided to use GetLastError(), as it has a separate error for each. However with the incorrect username it still gives me the code 12014? (password ...

Why does GetLastError() return different codes during debug vs "normal" execution?

try { pConnect = sess->GetFtpConnection(ftpArgs.host, ftpArgs.userName, ftpArgs.password, port, FALSE ); } catch (CInternetException* pEx) { loginErrCode = GetLastError(); printf("loginErrCode: %d\n", loginErrCode); if(loginErrCode == 12013) { printf("Incorrect user name!\n"); exit(0); } ...

How to Prevent dialog (Basic Authentication prompt) during call of Webservice

Hi In a delphi program (running as a service) i need to call some webservices. The calls works fine if basic Authentications is not requerired. The calls also works fine if Basic Authentication is requerired and username/password is provided (in BeforePost) using: InternetSetOption(Data, INTERNET_OPTION_USERNAME,... InternetSetOption(...

Getting redirect information with C# and C++

Hi all. What am I doing wrong? I'm trying to get redirect information from a server that I use for authenticating a user. This works good with my C# code but I cannot make my C++ code working. So here's the working C# code: string postData = @"username=myUsername&serviceID=someServiceId&password=somePassword"; byte[] postBytes = Encodin...

Call server with WinInet and WinHTTP

Hi all, I have a request that works fine when I use the WinInet API. I now want to make that request with the WinHTTP API as I already use it in my project and as it is simply better. My request is used for calling JSON. I already authenticated before calling this. When authenticating I get a SessionID that I send via cookie. So here is ...

Problem with FtpFindFirstFile

I want to download all file from ftp directory i want use for that FtpFindFirstFile and FtpGetFile; LPWIN32_FIND_DATA FileData; TCHAR* APP_NAME = TEXT("ftpcli"); TCHAR* PATH_FTP = TEXT("ftp://127.0.01"); TCHAR* ADR_FTP = TEXT("127.0.0.1"); TCHAR* LC_FILE = TEXT("C:\\!"); TCHAR* PATH_FILE = TEXT("/Soft/DVD_Players/WinDVD6"); UINT a; HI...

Soap Delphi Client end with a timeout for a 1MB call

Hi, we are developing a SOAP webservice (Apache/PHP). All run well for small size calls, but with a 1Mb soap call (the HTTPS call size is 1MB) our Delphi Soap client stop with a timeout on all PC but one, and our PHP clients run well with a default_socket_timeout=300, but stop with a "Error Fetching http headers" with default_socket_ti...

HttpSendRequest not getting latest file from server

I am having an issue with my HTTP requests in my app, such that if the remote file is the same size as the local file (even though its modified time is different, as its contents have been changed), attempts to download it return quickly and the newer file is not downloaded. In short, the process I am following is: Setting up an HTTP co...

Getting authentication token after a HttpSendRequest

The following code will log in my application to a server. That server will return an authentication token if the login is successful. I need to use that token to query the server for information. egressMsg := pchar('email='+LabeledEdit1.text+'&&password='+MaskEdit1.Text+#0); egressMsg64 := pchar(Encode64(egressMsg)); Reserved :=...

Wion32's HttpSendRequest : ERROR_INTERNET_INCORRECT_HANDLE_STAT

I have C++ Win32 app that uses HttpSendRequest to request some URL (via https). It worked OK earlier; but then errors ERROR_INTERNET_INCORRECT_HANDLE_STATE began happen. Why these ones? Any ideas? ...

Which accessType should I use when calling InternetOpen?

According to the MSDN, you can specify an access type parameter to InternetOpen. Two of the options for the dwAccessType parameter are: INTERNET_OPEN_TYPE_DIRECT - Resolves all host names locally. INTERNET_OPEN_TYPE_PRECONFIG - Retrieves the proxy or direct configuration from the registry. Which of these should I use? I don't kno...

How to send a HTTP Post Request in Delphi 2010 using WinInet

Hi, I want to send a HTTP Post Request in Delphi 2010 using WinInet, but my script doesn't work ;/ It's my Delphi script: uses WinInet; procedure TForm1.Button1Click(Sender: TObject); var hNet,hURL,hRequest: HINTERNET; begin hNet := InternetOpen(PChar('User Agent'),INTERNET_OPEN_TYPE_PRECONFIG or INTERNET_OPEN_TYPE_PRECONFIG, nil, ...

How do I get through proxy server environments for non-standard services?

I'm not real hip on exactly what role(s) today's proxy servers can play and I'm learning so go easy on me :-) I have a client/server system I have written using a homegrown protocol and need to enhance the client side to negotiate its way out of a proxy environment. I have an existing client and server system written in C and C++ for t...

How to send image data with HttpSendRequest ?

I want to send an image using HttpSendRequest API. Basically I want to Post the request with some string parameters and after those params I need to send raw image data. So is it okay to creata a unsigned char buffer of lengh equal to size of strings plus image file size and then doing memcpy of strings and memcpy of image data? ...

Copy binary image data into a string

I need to send image data over network using HttpSendRequest POST request. For this purpose I am creating a string , adding some parameters to string, then I need to add raw image data. Now I would like to know how can I send the image in post request. ...

Uploading image to flicker in c++

I am creating an application in VC++ using win32,wininet to upload an image to Flickr.I am able to get Frob,Token correctly but when I try to upload the image I am getting error Post size too large. Headers are created as follows wstring wstrAddHeaders = L"Content-Type: multipart/form-data;boundary=ABCD\r\n"; wstrAddHeaders ...

sending sms from windows application

I am creating a windows application which needs to send some sms to mobile phone.This is just for testing purpose. Now can I use my cell phone to get this done. I have android phone which can be connected to pc using USB. Application is created in C++, windows api. Any pointers will help ...

Using a specific network interface for a WININET HTTP request

Is there a way to specify which local network interface to use when using the WININET interface for an outgoing HTTP request? I know how to do it with WINSOCK (using bind()), but I can't find an equivalent way to do it using WININET. ...

[VB] Wininet FTP invalid files

Hello everybody. I am bussy with a script, what must upload a Zip-archive to a ftp server. This works, unfortuantely the Zip file on the ftp server is incorrupt, the local file before it is placed on the server works fine. Does someone know what the problem could be? This is de relative code: Private Sub ftpWorker_DoWork(ByVal sender ...