Ver Mensaje Individual
  #8  
Antiguo 01-06-2006
BlackFreD BlackFreD is offline
Registrado
 
Registrado: may 2006
Posts: 9
Reputación: 0
BlackFreD Va por buen camino
He seguido haciendo pruebas y no consigo nada.

El codigo del formulario es el siguiente:

Código PHP:
<form enctype="multipart/form-data" action=" <?PHP echo "alta_noticia.php?" SID;  ?>" method=post>
...
<table>
  <tr>
    <td valign="top"><input type="hidden" name="MAX_FILE_SIZE" value="1000"><span class="Estilo1">Imagen: </span></td>
    <td><input name="form_image_file" type="file" id="form_image_file"></td>
  </tr>
</table>
...
</form>
El codigo php es el siguiente:
Código PHP:
$usr_file_name $_FILES["form_image_file"]["tmp_name"]; 
$usr_file $_FILES["form_image_file"]["name"]; 
$usr_file_size $_FILES["form_image_file"]["size"]; 
$usr_file_type $_FILES["form_image_file"]["type"]; 
                                
echo 
"Info del fichero -> FileName: " $usr_file_name " File: " $usr_file " FileSize: " $usr_file_size " FileType: " $usr_file_type;

if (
$usr_file_name != "none")
{                                            
  
$fp fopen($usr_file_name"rb");
  
$img2save fread($fp$usr_file_size);
  
$img2save addslashes($img2save);
  
fclose($fp);

Conecto a la bdd y la actualizo:

$result = mssql_query("INSERT INTO Noticias (DataPubli,DataDel,Tit,Res,Desc,Img,Link) VALUES ('" . $data2publi . "','" . $data2del . "','" . $form_tit_new . "','" . $form_res_new . "','" . $form_desc_new . "','" . convert(binary, '$img2save') . "','" . $form_link_new . "')");


Cuando miro el echo de la url php me devuelve:

Info del fichero -> FileName: File: FicheroPrueba.jpg FileSize: 0 FileType:

Como podéis ver no me devuelve el nombre del fichero temporal, ni el tamaño ni el tipo mime....

No se que debo de estar haciendo mal.

Si tenéis alguna idea os lo agradeceré!

Muchas gracias!

Última edición por kayetano fecha: 01-06-2006 a las 14:55:44.
Responder Con Cita