Avatar of sungenwang
sungenwangFlag for United States of America

asked on 

How do I programmatically submit data to a web page?

Hi,

I am trying to write something in Visual C++ 6.0 that will do the following in a certain time interval (e.g. twice a day):

1. Log on to a secure website with a valid user id and password.
2. Set the value of an input text box to the full path of a file name (e.g. C:\upload.csv)
3. Submit this page.

Your help is appreciated!

Sung-En
C++

Avatar of undefined
Last Comment
sungenwang
SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of sungenwang
sungenwang
Flag of United States of America image

ASKER

Hi khkremer, thanks for the detailed input. However, it is pretty touch for me (a c programmer) to decipher this to c code.

Hi Chensu, I think the code in the first link should be very helpful! I well test it.

However, is there a way I can submit my user id and password to a webpage by putting them inside an url? I think I just read it somewhere yesterday but I can't find that "tip of the day" article! If you experts can help me locate it, that would be enough to close my questions!
You just need to send the data (after replacing certain things like the Referer, authorization information or the file size information) to port 80 on the web server.

Providing a user name and password as part of the URL only works of the script on the server does support this. THis information is usually provided as "Authorization:" information.

I looked at the three links provided by chensu, but did not see anything about file uploads.
Avatar of chensu
chensu
Flag of Canada image

>but did not see anything about file uploads.

I don't think sungenwang needs to upload files. What sungenwang is doing is to post the upload file name to a Web site.
Makes sense. I got confused by the filename upload.cvs and assumed that the requirement was to actually upload the file.
Avatar of sungenwang
sungenwang
Flag of United States of America image

ASKER

Chensu is right. Just the file name.

Any luck in finding the article on sending the id & password? I believe it was something like:
www.idname:password:domainname.com
I tried
Avatar of sungenwang
sungenwang
Flag of United States of America image

ASKER

I tried several different combinations and non of them worked... I couldn't believe I didn't print out that page when I first saw it...
Avatar of sungenwang
sungenwang
Flag of United States of America image

ASKER

hi khkremer, do you happen to know the syntax for:
"Providing a user name and password as part of the URL"? Even though you mentioned that it may only if the server does support this. Who knows, it may just work for me...
Avatar of chensu
chensu
Flag of Canada image

You can provide a user name and password as part of the URL for FTP.

How to Enter FTP Site Password in Internet Explorer
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q135975
There is no standard way of passing the user id and a password as part of a URL (besides for ftp, as chensu has already explained). It depends on the server setup and is in general a bad idea, because this information will be displayed on the screen (everybody who walks by your machine can see this information), but is also stored in your browser's history.

Just ignore all the low level stuff I had in my comment. Just adding the file name is possible with the information in the articles that chensu quoted.
SOLUTION
Avatar of phyderous
phyderous

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of sungenwang
sungenwang
Flag of United States of America image

ASKER

Thanks to you all!
I think I'm on my way now... sungen
C++
C++

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.

58K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo