Ver Mensaje Individual
  #8 (permalink)  
Antiguo 22/04/2009, 12:16
Avatar de SergeMedina
SergeMedina
 
Fecha de Ingreso: septiembre-2007
Ubicación: Guadalajara, Jalisco
Mensajes: 459
Antigüedad: 16 años, 7 meses
Puntos: 20
Respuesta: Subir foto y grabar la imagen en db

Algo parecido a:

Código PHP:
if($boton) {
    
$rutaDe_Carpeta="Carpeta/donde/quieres/guardar";
    if (
is_uploaded_file($HTTP_POST_FILES['/Gallery1/archivo']['tmp_name'])) {
        if(
$HTTP_POST_FILES['archivo']['size'] < 85000) {
            if(
$HTTP_POST_FILES['archivo']['type']=="image/gif" || $HTTP_POST_FILES['archivo']['type']=="image/jpeg" || $HTTP_POST_FILES['archivo']['type']=="image/pjpeg") {            
                
copy($HTTP_POST_FILES['archivo']['tmp_name'], $rutaDe_Carpeta.$HTTP_POST_FILES['archivo']['name']);
                
$subio true;
            }
        }
    } 
Un tip: si estas utilizando PHP 5 es mas recomendable que reemplazes las variables $HTTP_POST_FILES por $_FILES ya que $HTTP_POST_FILES ya estan en desuso (deprecated), funcionan igual.