473,586 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send file over internet using http headers

Hi All,

I'm new to VC++.net and I searched through the forums and couldn't
find anything related to this.

I'm trying to send a flat file from a VC++.net program to a PHP file
residing on a webserver. I know you can call a website from
VC++.net, but I'm not sure how to send a physical file over the
internet. I mean is there a way to mimic a normal html form to
upload a file, using VC++.net?

Any information or links would be appreciated.

Thanks.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #1
1 1619
Raichu wrote:
Hi All,

I'm new to VC++.net and I searched through the forums and couldn't
find anything related to this.

I'm trying to send a flat file from a VC++.net program to a PHP file
residing on a webserver. I know you can call a website from
VC++.net, but I'm not sure how to send a physical file over the
internet. I mean is there a way to mimic a normal html form to
upload a file, using VC++.net?

Any information or links would be appreciated.


You can make an HTTP POST using any number of technologies including:

0. Winsock
1. WinInet (wrapper over Winsock)
2. WinHttp
3. MFC (wrapper over WinInet)
To send a file you need to simulate a form-url-encoded posting with an
appropriate MIME type. Basically, you need to build of a string that
contains the necessary headers and content to simulate a form post, and then
send it using one of the technologies above.

You can learn all the details of the form encoding by looking at the
apprproaite RFCs at www.ietf.org. Some RFC numbers that would be of
interest include:

2045, 2046, 2047, 2048, 2049, 2854

another technique is to use a network monitor ("packet sniffer") to capture
the data sent by a standard web browser (such as IE) when executing the
actual form post. You then simply substitute your file data into the post
at the appropriate place (and set the content length correctly, of course).

-cd
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2665
by: edykstra | last post by:
Hello, If you point your browser to this page, http://prdownloads.sourceforge.net/vnc-tight/tightvnc-1.2.9_x86_viewer.zip?use_mirror=umn the server sends you the HTML page, and very soon afterwards, you are prompted to do a 'Save-As' for a file to download. How do they do that without the classic "Headers already sent" error?
1
5742
by: Mohan | last post by:
Hi All, I am using web browser control in a VB 6.0 client server application to print reports. I am writing the report into a HTML file and displays the report to the user using the code, webbrowsercontrol.navigate2 "path of the html file" method. When the user clicks command button on the VB form to print the report I am using the...
1
6559
by: Lakshmi Narayanan.R | last post by:
Hi Experts, In one SMS gateway project i need a great and urgent help from u all. There, the Service Providers sending the data thru "HTTP Headers" (For ex. sms-Id,sms-source ). So i need to get and parse the name value pairs, and need to respond/send the same way as coining the "HTTP Headers" (For ex. sms-Id,sms-destination,sms-msg ). ...
2
2519
by: Lisa Pearlson | last post by:
Hi, My php application (on Apache/Linux) needs to do the following: The PHP script receives a request from a client (binary), asking for certain records of data. My PHP script loops through all records and sends each of them ONE BY ONE. After each record that my server script sends, it waits for the client to confirm proper reception...
2
20740
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none But the problem occures when i want to send a data with & sign (i.e: Firm=F&B). I try to solve this problem with using boundary, but i failed. Any...
1
4583
by: john bailo | last post by:
I am trying to write a c# program to access Outlook internet headers for messages in a public folder. When I look at these messages in Outlook, and select View/Options, there is information in the Internet Headers scrollbox. BUT -- when i run the Visual Basic code ( so far this is the only documented method I have found, so I'm converting...
2
3678
by: sufian | last post by:
<input type="image" id="imageField" class="btn" src="<?php bloginfo('template_url'); ?>/media/global/btn-go.gif" onclick = "sendRequestPost(document.getElementById('email1').value);" /> The function sendRequestPost() is in a file named header.php: function sendRequestPost(data) { // Open PHP script for requests ...
1
2410
by: Chitu03 | last post by:
Hi I am already send a mail using Php with some attachement into it. My Problem is the attachement file is in my Database(mysql). I don't know how can i get from database and then add to my mail. <?php function send_mail($emailaddress, $fromaddress, $emailsubject, $body, $ccaddress, $attachments=false) { $eol="\r\n"; ...
1
3200
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the code for attachment, I am not able to send anything. I get blank email. Can you please help me on this? Here is the html form:
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.