Ver Mensaje Individual
  #7 (permalink)  
Antiguo 21/05/2009, 19:57
Avatar de chulifo
chulifo
 
Fecha de Ingreso: abril-2009
Ubicación: perdido en codigos del PHP, pero aprendo rapido!
Mensajes: 524
Antigüedad: 15 años
Puntos: 18
De acuerdo Respuesta: Upload con PHP (aportación)

HOla man weno discupa pero estaba buscando esto y mira edte el codigo para ser un solo archivo mira aka


Código PHP:
<form enctype="multipart/form-data" action="<?=$PHP_SELF?>?action=upload" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
<?php
// Where the file is going to be placed  
$target_path "uploads/"

/* Add the original filename to our target path.   
Result is "uploads/filename.extension" */ 
$target_path $target_path basename$_FILES['uploadedfile']['name']);  

$target_path "uploads/"

$target_path $target_path basename$_FILES['uploadedfile']['name']);  

if(
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { 
    echo 
"The file ".  basename$_FILES['uploadedfile']['name']).  
    
"El Archivo Se ha Subido Correctamente!"
} else{ 
    echo 
"Error En Subir El Archivo Intenta de Nuevo!"
}  

?>