Forum Moderators: coopster

Message Too Old, No Replies

Send file contents as stream over HTTP

         

ljt540

11:01 pm on Apr 20, 2006 (gmt 0)

10+ Year Member



Are there any examples of opening a file, storing the contents in a variable, then posting as a data stream over HTTP using PHP? I don't need to upload the file. I need the actual contents to be sent as a data stream using the POST method to a remote web server script.

Thanks in advance!

hakre

9:34 am on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



shure, php can do everything which is tcp/ip based and POST is based on this via the HTTP protocol.

if you need to know how this is done, start with the definition. these are documented in so called RFC files and you can dig up them by a searchengine. anyway, sometimes it's hard to find the correct RFC document and sometimes, because of the technical nature, it's hard to understand those.

a good start might be here:
[w3.org...]

the http 1/1 protocol (which describes even a lot more) can be found here:

[ietf.org...]

anyway this is technical and you do not want to dig through all this, because other people already did. and they were that nice to publish all this under PHP License:

[pear.php.net...]

anyway, pear is a good start to find some re-useable code to extend your php.

ljt540

2:41 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



Okay, great I'll start reading...

The project that I am working involves web enabling some existing mainframe applications that are written in a 4GL language called Natural. I am using a middle-ware product called EntireX and several other utilities on the mainframe side...

Basically, the data stream coming from the client/server side will be used as input to a sub program on the mainframe side.

On the mainframe side I will exam the incoming stream for key values and handle the data accordingly. It's an interesting project that I'm thankful to be working on.

Regards