At a first glance:

  $fp=fopen(brianLog1, "w+");

brianlog1 should either be in quotes if that's the name of the file and the
file doesn't have an extension. Or maybe it's a variable in which case
you'll need to put the $ in front of it..

Hope that helps

Regards

Chris



-----Original Message-----
From: Brian Moynihan [mailto:[EMAIL PROTECTED]
Sent: 26 September 2003 10:25
To: [EMAIL PROTECTED]
Subject: [PHP] How to accept file through http from curl c program??


Hi there,

Hopefully someone can shed some light for us on this.

We have a client who is sending us a file through a C program which uses
Curl. At our end we have a php script to accept the file passed through the
form. This php script works fine using a browser however, it does not pick
up what the C program sends to us.

Our php is below, $_FILES contains zilch!! Any ideas?:

  foreach( $_FILES as $varname => $fileinfo ){
    $filename = $fileinfo["name"];
    $tmpname  = $fileinfo["tmp_name"];
  }

  $uploaddir = '/usr/local/nameofdir/;
  $uploadfile = $uploaddir. $_FILES['filename']['name'];

  if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) {

    $fp=fopen(brianLog1, "w+");
    $string = "HTTPS POST of Purchase Order SUCCESSFUL.************ File
Name: ".$_FILE['filename']['name']."\n";
    fwrite($fp, $string);
  }
  else {
    $fp=fopen(brianLog2, "w+");
    $string = "HTTPS POST Failed !************* File Name:
".$_FILES['filename']['name']."\nTmp Name: "
.$_FILES['filename']['tmp_name'];
    fwrite($fp, $string);

  }
?>
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to