Hola, vull pujar una imatge a la meva carpeta "images". Si sobreescric un fitxer jpg (segon.jpg) creat manualment en aquesta carpeta no tinc cap problema (linia entre comentaris). Pero si vull fer-ho automáticament, és a dir, conservant el nom original de l'arxiu no em funciona, adjunto el codi per si algú veu algo raro ràpid. Haig de modificar algo de permisos?
<html>
<head>
<title>Pujar Fitxers</title>
</head>
<body>
<?php
$arxiuorigen = $_FILES['upload_test']['tmp_name']; //variable formulario upload
$arxiuthumbnail = '/home/sopadesi/public_html/images/'.$_FILES['upload_test']['name'];
//$arxiuthumbnail = '/home/sopadesi/public_html/images/segon.jpg';
exec("/usr/bin/convert '$arxiuorigen' -thumbnail 100x100 '$arxiuthumbnail' &");
?>
<form enctype="multipart/form-data" action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1024000">
<input name="upload_test" type="file">
<input type="submit" value="test upload">
</form>
<?php
$debuga="images\segon.jpg";
$debuga2="images\\".$_FILES['upload_test']['name'];
?>
<img src="<?php echo $debuga2; ?>" width="210" height="40">
<br>
<?php echo $_FILES['upload_test']['tmp_name']; ?>
<br>
<?php echo $_FILES['upload_test']['name']; ?>
<br>
<?php echo $_FILES['upload_test']['size']; ?>
<br>
<?php echo $_FILES['upload_test']['type']; ?>
<br>
<?php echo $_FILES['upload_test']['error']; ?>
<br>
<?php echo $debuga2; ?>
</body>
</html>
Gracies