Forum Moderators: coopster

Message Too Old, No Replies

Can I POST a file to a third party site?

Send file data as if it came from a form

         

grahamstewart

2:51 am on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




I'd like to write some PHP scripts that will:

  • allow the user to enter the address of a file
  • download that file to a temporary file on my server
  • monkey about with the file a little
  • then submit the temporary file to another site in the same manner as if it had been POSTed from a form on that site.

    So basically what I'm asking is: what is the best way to POST a file to a third party site so that it appears as if the file had simply been selected on a form?

    I guess I could open a socket to the third party site and send all the neccessary HTTP data that way, but I was hoping for something a little more high level.

  • jatar_k

    2:54 am on Jan 14, 2004 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member



    have you looked at curl [ca.php.net]?

    grahamstewart

    2:59 am on Jan 14, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Sweet - that looks like the business! :)

    Thanks very much jatar