Bluehost.com Web Hosting $6.95

How to accept file through http from curl c program??

This is a discussion on How to accept file through http from curl c program?? within the PHP General forums, part of the PHP Programming Forums category; Hi there, Hopefully someone can shed some light for us on this. We have a client who is sending us ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-26-2003
Brian Moynihan
 
Posts: n/a
Default 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);

}
?>

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:09 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0