cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: Uploading a file through curl + php

From: Matt Parkins <matt_at_parkins.uk.net>
Date: Wed, 22 Dec 2004 12:59:33 -0000

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks for your very helpful post! That article on http scripting
helped me lots!

This works fine from the commandline:

        curl -F myfile=@myfile.dat
http://localhost/prj/ccdw/functions/processreturndata.php

I'm actually writing the receiving program (processreturndata.php).
PHP has global variable called $_FILES which contains information
regarding any files it has recieved (filename, filesize, etc).
Calling the above from the commandline returns the following in this
variable:

Array
(
    [myfile] => Array
    (
        [name] => myfile.dat
        [type] => application/octet-stream
        [tmp_name] => C:\WINDOWS\TEMP\php149.tmp
        [error] => 0
        [size] => 1055
    )
)

So it works from the commandline. So my question is which php
options do I need to set to do this multipart/form-data HTTP post ?

Thanks again,

Matt

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBQclvtCtTzPm4J+DXEQJfZgCgwPbCWTOL6AMIf3TKeFTMy6deiUwAnRPA
KFaJvzkCfOrRbUYD7n0wgCl/
=p2xV
-----END PGP SIGNATURE-----
Received on 2004-12-22