Fonction File Uploads Php - Page 2

Résolu
  1. Contributeur
    évidement, mon code enlève le dossier…
    cerveau au ralenti cette nuit et tu ne m'aides pas des masses !
    -:oD
    define('UPLOAD_DIR', 'uploads/');
    $target_path = UPLOAD_DIR.basename( $_FILES['uploadedfile']['name']);
    while(file_exists($target_path))
    {
    	$name = pathinfo($target_path, PATHINFO_FILENAME);
    	$ext = pathinfo($target_path, PATHINFO_EXTENSION);
    	$target_path = UPLOAD_DIR.$name.rand(0, 9).'.'.$ext;
    }
    1. MERCI sait bon sa marche !!!!!!!
      1. Contributeur
        désolé pour les pertes de temps et bon courage pour la suite !
    2. j'ai encore un probleme comment je peut faire pour affichez l'adresse ou l'images a été envoyez ??
      1. Contributeur
        if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
            echo '<p><a href="'.$target_path.'">'. $target_path.'</a></p>';
        } else{
            echo "There was an error uploading the file, please try again!";
        }
        Précédent
        • 1
        • 2