Re: How to accept file through http from curl c program??
| From: | Brian Moynihan | Date: | Fri, 26 Sep 2003 13:49:41 +0000 |
| Subject: | Re: How to accept file through http from curl c program?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164039@lists.php.net to get a copy of this message | ||
Thanks Mike,
I set the content type to be text/xml in the C program. Just don't
understand it at all. There appears to be no reason why it's not working.
Thanks for your help so far, any more suggestions?
Brian.
----- Original Message -----
From: "Mike Brum" <php@crazyted.com>
To: "'Brian Moynihan'" <brian.moynihan@3procure.com>;
<php-general@lists.php.net>
Sent: Friday, September 26, 2003 1:36 PM
Subject: RE: [PHP] How to accept file through http from curl c program??
> I don't really know much about Curl, but what it -sounds- like is that
Curl
> isn't sending the proper headers/MIME types to the PHP script and PHP
isn't
> putting the input into the $_FILES array. You might want to look in your
> $_GET or $_POST array for existance of the file to see if it's being sent
> there.
>
> Good luck.
>
> -M
>
> -----Original Message-----
> From: Brian Moynihan [mailto:brian.moynihan@3procure.com]
> Sent: Friday, September 26, 2003 6:44 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] How to accept file through http from curl c program??
>
>
> Thanks Chris but I don't think that is the issue as the file is being
> created and the script is running through.
>
> It's just that $_FILES contains no data which it should?? I is confused as
> they say because it works perfectly using the browser ...
>
> ----- Original Message -----
> From: <chris.neale@somerfield.co.uk>
> To: <brian.moynihan@3procure.com>; <php-general@lists.php.net>
> Sent: Friday, September 26, 2003 12:29 PM
> Subject: RE: [PHP] How to accept file through http from curl c program??
>
>
> > 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:brian.moynihan@3procure.com]
> > Sent: 26 September 2003 10:25
> > To: php-general@lists.php.net
> > 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
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>