file transfering
can i do this and how should i go about it...
i want to run a program. And when you run the program, I want the program to download a file off a web site....for example:
i want to run the program then immediately download http://www.mySite.com/document.txt.......then i want to read this file into my program (which i know how to do)......do some computations (which i can do)......then save the file back to http://www.mySite.com/document.txt
can i do this ? and if so how do i go about it ?
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
The WinInet api is what you''re looking for. The CHttpFile and CFtpFile classes are MFC wrappers... WinInet is a very high level API relative to network communication, so you can skip MFC if you''re not already using it... you''ll end up with very similiar code.
do you know where i can get some info on WinInet ?
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
For every API from M$, look in the MSDN. I don''t know if CHttpFile itself is able to upload something. Perhaps you should think about using FTP instead of HTTP.
Coder10000
Coder10000
ncsu121978,
If you want to use MFC, I have a couple of classes that wrap up the WinInet stuff. I can send them your way if your interested.
Or you''ll have to roll your own... If you go this route, you''ll need some info on how FTP works, grab the RFC for FTP and do some research, it isn''t too difficult. I''m sure that you can find a FTP Winsock class on the net as well.
Good Luck,
Dave "Dak Lozar"Loeser
If you want to use MFC, I have a couple of classes that wrap up the WinInet stuff. I can send them your way if your interested.
Or you''ll have to roll your own... If you go this route, you''ll need some info on how FTP works, grab the RFC for FTP and do some research, it isn''t too difficult. I''m sure that you can find a FTP Winsock class on the net as well.
Good Luck,
Dave "Dak Lozar"Loeser
I used the WinInet functions and they worked really well for me and they were VERY easy to use. I think I made about 5 function calls and I could transfer the file.
1)Initialize a connection to the internet
2)initialize an ftp session
3) get the file
4)close the ftp session
5)close the internet connection
but thanks for the reply
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
1)Initialize a connection to the internet
2)initialize an ftp session
3) get the file
4)close the ftp session
5)close the internet connection
but thanks for the reply
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
If you wanna do http then do this. This requires winsock tcp/ip programming.
to download http://www.nothing.com/something.jpg do this
1. Connect to "www.nothing.com"
2. Send out "GET /something.jpg" to the server
3. Wait for data and place it in a buffer
4. When server disconnects, save the buffer to something.jpg
and you''re done.
---------------------------
No such thing as an innocent soul who lies to the world who he loves so much
to download http://www.nothing.com/something.jpg do this
1. Connect to "www.nothing.com"
2. Send out "GET /something.jpg" to the server
3. Wait for data and place it in a buffer
4. When server disconnects, save the buffer to something.jpg
and you''re done.
---------------------------
No such thing as an innocent soul who lies to the world who he loves so much
you can call me whatever you like as long as you attempt to answer the questions........
thanks for the reply nes8bit but I have it working just like I want it to right now.
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
thanks for the reply nes8bit but I have it working just like I want it to right now.
"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement