<?php

define(FILES_PATH, '/var/www/html/poze/');

// daca s-a uploadat fisierul img1
if(is_uploaded_file($_FILES['img1']['tmp_name'])) {
        if(copy($_FILES['img1']['tmp_name'], FILES_PATH . 
$_FILES['img1']['name'])) {
                chmod(FILES_PATH . $_FILES['img1']['name'], 0644);
                // file uploaded and copied succesfully
                $file1_name = $_FILES['img1']['name'];
        } else {
                // eroare
                $error_msg = "An error has occured when uploading img1!";
                error_log($error_msg);
        }
}
// end if upoad fisier img1

?>


<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" 
enctype="multipart/form-data">
        <table border="0">
                <tr>
                        <td>Imagine 1</td>
                        <td>
                                <input type="file" name="img1">
                        </td>
                </tr>
</form>



Dan Uscatu wrote:
> salut
> 
> avind nevoie sa debughez o prostie de aplicatie, am nevoie de cea mai
> banala sursa php prin care sa pot face upload la un fisier undeva pe
> server. ceva exemple ?
> 
> multumesc
> 
> "Live to Win, Dare to Fail" - James Hetfield
> 
> 
> 
> 
> --- 
> Detalii despre listele noastre de mail: http://www.lug.ro/
> 
> 

-- 
You can get much further with a kind word and a gun than you can with a 
kind word alone.

--- 
Detalii despre listele noastre de mail: http://www.lug.ro/


Raspunde prin e-mail lui