curl-users
POST + FORM PHP probleme :(
Date: Fri, 4 Jun 2004 16:13:21 +0200
Hi :)
I'l looking to post a file thanks to cURL (in command ligne)
to do that i have 2 php pages.
when I do :
#>curl -F upload=./client.cer -F press=OK http://(my_serveur)/upload.php
it doesn't work :(
cURL just show my the php code of my page :(
can you help me please :p
thanks
+++
Nicolas
########################
_the 1st file : index.php_
<form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Envoyez ce fichier : <input name="upload" type="file" />
<input type="submit" value="Envoyer le fichier" name="ok"/>
</form>
#######################
_the 2nd file : upload.php_
<?php
$uploaddir = './up/';
if (move_uploaded_file($_FILES['upload']['tmp_name'], $uploaddir . $_FILES['upload']['name'])) {
echo "OK";
} else {
echo "KO";
}
?>
#######################
Received on 2004-06-04