I'm trying to make a script that makes a HTTP POST with some headers, and with a file as the body. I've found all sorts of documentation online about making a HTTP POST with headers, but can't figure out how to make the POST with a file as a body.

The file is actually uploaded via another HTML POST. My program's architecture looks like this:

User uploads file via HTML Post -> intermediary script -> POST file to a website

Is there some good documentation on how to make a HTTP POST in PHP with both headers and a body? Alternatively, does anyone have some quick sample code? This should be really simple, but I can't seem to figure it out. :(

Member Avatar for P0lT10n

i didn't understand what is your problem... explain better...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.