[Système] Transfert automatique d'image local->serveur
Bonjour,
Je souhaite mettre en place un transfert automatique d'images du local sur le serveur, à l'aide d'un input type="file".
J'ai fait ceci:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<form ENCTYPE="multipart/form-data" action="index2.php" method="post" name="form1" id="form1" onsubmit="return verification()">
...
<tr>
<td bgcolor="#F2F2F2" class="Style6">Photo ligne produit<br />
</td>
<td bgcolor="#F2F2F2" class="Style13"><input type="file" value="" name="imgmini" id="imgmini" size="30" /></td>
</tr>
<tr>
<td class="Style6">Photo page produit</td>
<td class="Style13"><input type="file" value="" name="imgprod" id="imgprod" size="30" /></td>
</tr>
...
</form> |
Puis dans le deuxième fichier:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
$nomDestination=$_FILES["imgmini"]["name"];
if (copy($_FILES['imgmini']['tmp_name'], "http://www.mon-cheval.fr/httpdocs/images/produits/$nomDestination"))
{
echo("<B>Fichier $nomDestination copié avec succès</B>");
}
else
{
echo("<B>La copie du fichier $nomDestination a échoué...</B>");
}
@unlink($_FILES["imgmini"]["tmp_name"]);
$nomDestination2=$_FILES["imgprod"]["name"];
if (copy($_FILES['imgprod']['tmp_name'], "http://www.mon-cheval.fr/httpdocs/images/produits/$nomDestination"))
{
echo("<B>Fichier $nomDestination2 copié avec succès</B>");
}
else
{
echo("<B>La copie du fichier $nomDestination2 a échoué...</B>");
}
@unlink($_FILES["imgprod"]["tmp_name"]); |
Mais ca ne marche pas.
Voici l'erreur qu'on me renvoi:
Citation:
Warning: copy(
http://www.mon-cheval.fr/httpdocs/im...102003009V.jpg) [function.copy]: failed to open stream: HTTP wrapper does not support writeable connections. in /var/www/vhosts/mon-cheval.fr/subdomains/admin/httpdocs/l/md4.php on line 60
La copie du fichier 0102003009V.jpg a échoué...
Warning: copy(
http://www.mon-cheval.fr/httpdocs/im...102003009V.jpg) [function.copy]: failed to open stream: HTTP wrapper does not support writeable connections. in /var/www/vhosts/mon-cheval.fr/subdomains/admin/httpdocs/l/md4.php on line 71
La copie du fichier 0102003009.jpg a échoué...
Quelqu'un pourrait me dire pourquoi?
Je ne vois pas ce qui ne va pas...
Peut etre les droit du repertoire?
Ce n'est qu'une hypothèse...