14/07/2009, 08:51
|
| | Fecha de Ingreso: noviembre-2008
Mensajes: 4
Antigüedad: 16 años Puntos: 0 | |
Respuesta: Problemas con $_FILE['']['size'] <?php
@ob_start("ob_gzhandler");
class _aGeneUpFotos_ extends adalMySQLConect {
public $aGeneDbFotos = '_db_fotos_usuarios';
public $aGenePrimFoto = '_db_galeria_usuarios';
function _Form_ ($IdForm) {
global $FileNoSelect, $rootSecureModeAut, $Albumcreado;
if ($_POST['strupload'] == 1):
if (substr($_FILES['file_'.$IdForm]['name'], -4, 4) == '.jpg' or substr($_FILES['file_'.$IdForm]['name'], -4, 4) == '.JPG' or substr($_FILES['file_'.$IdForm]['name'], -4, 4) == '.gif' or substr($_FILES['file_'.$IdForm]['name'], -4, 4) == '.GIF' or substr($_FILES['file_'.$IdForm]['name'], -4, 4) == '.Gif' or substr($_FILES['file_'.$IdForm]['name'], -5, 5) == '.jpeg' or substr($_FILES['file_'.$IdForm]['name'], -5, 5) == '.JPEG'):
if($_FILES['file_'.$IdForm]['size'] < 1902000) {
if (is_uploaded_file($_FILES['file_'.$IdForm]['tmp_name'])) {
if($_FILES['file_'.$IdForm]['type']=="image/gif" || $_FILES['file_'.$IdForm]['type']=="image/jpeg" || $_FILES['file_'.$IdForm]['type']=="image/pjpeg") {
copy($_FILES['file_'.$IdForm]['tmp_name'], _FILEPATH_."CVStore/SharingForder/".$CodigoGuia.$_FILES['file_'.$IdForm]['name']);
$nombre_ext = $CodigoGuia.$_FILES['file_'.$IdForm]['name'];
$file_grande = _FILEPATH_."CVStore/SharingForder/".$CodigoGuia.$_FILES['file_'.$IdForm]['name'];
$image_grande = imagecreatefromjpeg($file_grande);
$width_grande = imagesx($image_grande);
$height_grande = imagesy($image_grande);
mysql_query("insert INTO ".$this->aGeneDbFotos." (imagen, id_galeria, activar)
values ('".$nombre_ext."', '".$_POST['getidgaleria']."', '1')");
@unlink (_FILEPATH_."CVStore/SharingForder/".$directorio);
$subio = true;
header("Location: misfotos.do?alid=".$_POST['getidgaleria']."");
}
}
} else {
$UpLoadSizeAlert = true;;
}
endif;
endif; // Activar subida
endif;
}
}
$UpLoad = new _aGeneUpFotos_;
$UpLoad->_Form_(1);
$UpLoad->_Form_(2);
$UpLoad->_Form_(3);
$UpLoad->_Form_(4);
?> |