Re: Accepting File Uploads from CURL
| From: | Manuel Lemos | Date: | Fri, 16 Jun 2006 01:52:31 +0000 |
| Subject: | Re: Accepting File Uploads from CURL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238131@lists.php.net to get a copy of this message | ||
Hello,
on 06/15/2006 11:56 AM Brad Bonkoski said the following:
> Hello All,
> I am using PERL to generate an XML file from a database query. no
> problems there.
> I then try to use curl to send it to an upload script.
> Essentially the command line looks like this: curl -H
> 'Content-Type:text/xml' -d file.xml server/up.php
> for my up.php I am just trying to dump stuff out, like the POST and
> FILES arrays
> Both those arrays are empty.
>
> Any thoughts on how to debug this, and/or suggestions for handling this?
You do not need to use a separate program to upload files with forms.
You can use PHP with socket connections.
Take a look at this pure PHP HTTP client class that lets you post files
for upload. You can just point it to a local file or some dynamically
generated data. It lets you choose the the file name in case you do not
want to use the local file name. Take a look at the test_http_post.php
example:
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/