Re: problemas con move_uploaded_file
| From: | Cesar A. | Date: | Thu, 01 Jun 2006 12:32:19 +0000 |
| Subject: | Re: problemas con move_uploaded_file | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-59021@lists.php.net to get a copy of this message | ||
Array ( [anexo_elect0] => Array ( [name] => C_V_MRD.pdf
[type] => [tmp_name] => [error] => 2 [size] => 0
) [anexo_elect1] => Array ( [name] => info.txt
[type] => text/plain [tmp_name] => /tmp/phpEuVjH6 [error] => 0
[size] => 33 ) [anexo_elect2] => Array ( [name] =>
anexo2.odt [type] => [tmp_name] => [error] => 2
[size] => 0 ) [anexo_elect3] => Array ( [name] =>
[type] => [tmp_name] => [error] => 4 [size]
=> 0 ) [anexo_elect4] => Array ( [name] =>
[type] => [tmp_name] => [error] => 4 [size] => 0
) ) Array ( [anexo_elect0] => Array ( [name] =>
C_V_MRD.pdf [type] => [tmp_name] => [error] => 2
[size] => 0 ) [anexo_elect1] => Array ( [name] =>
info.txt [type] => text/plain [tmp_name] => /tmp/phpEuVjH6
[error] => 0 [size] => 33 ) [anexo_elect2] => Array (
[name] => anexo2.odt [type] => [tmp_name] =>
[error] => 2 [size] => 0 ) [anexo_elect3] => Array (
[name] => [type] => [tmp_name] => [error]
=> 4 [size] => 0 ) [anexo_elect4] => Array (
[name] => [type] => [tmp_name] => [error] => 4
[size] => 0 ) ) Array ( [anexo_elect0] => Array (
[name] => C_V_MRD.pdf [type] => [tmp_name] =>
[error] => 2 [size] => 0 ) [anexo_elect1] => Array (
[name] => info.txt [type] => text/plain [tmp_name] =>
/tmp/phpEuVjH6 [error] => 0 [size] => 33 ) [anexo_elect2]
=> Array ( [name] => anexo2.odt [type] =>
[tmp_name] => [error] => 2 [size] => 0 )
[anexo_elect3] => Array ( [name] => [type] =>
[tmp_name] => [error] => 4 [size] => 0 )
[anexo_elect4] => Array ( [name] => [type] =>
[tmp_name] => [error] => 4 [size] => 0 ) ) Array (
[anexo_elect0] => Array ( [name] => C_V_MRD.pdf [type] =>
[tmp_name] => [error] => 2 [size] => 0 )
[anexo_elect1] => Array ( [name] => info.txt [type] =>
text/plain [tmp_name] => /tmp/phpEuVjH6 [error] => 0
[size] => 33 ) [anexo_elect2] => Array ( [name] =>
anexo2.odt [type] => [tmp_name] => [error] => 2
[size] => 0 ) [anexo_elect3] => Array ( [name] =>
[type] => [tmp_name] => [error] => 4 [size]
=> 0 ) [anexo_elect4] => Array ( [name] =>
[type] => [tmp_name] => [error] => 4 [size] => 0
) )
Cr3m4t0rY <cr3m4t0ry@gmail.com> escribió: haz un print_r($_FILES) en el script que recibe el
form y ponlo aqui
El 1/06/06, Cesar A. escribió:
> acabo de hacer un
>
> echo "name: ".$nombre_archivo." tmp_name: ".$nombre_tmp;
> y para un archivo pdf, y otro odt, no me mostró nada en el tmp_name
>
> "Cesar A." escribió: Saludos a todos...
>
> Estoy teniendo un comportamiento, que para mi es extraño, en la subida de archivos con
> move_uploaded_file ... les cuento:
>
> el form:
>
>
> el php:
>
>
> $nombre_archivo =
> "'".$_FILES['anexo_elect'.$j]['name']."'";
> $tamagno_archivo = $_FILES['anexo_elect'.$j]['size']; $tipo_archivo =
> $_FILES['anexo_elect'.$j]['type']; $nombre_tmp =
> $_FILES['anexo_elect'.$j]['tmp_name']; $desc_archivo =
> "'".$_POST["desc_anexo".$j]."'"; $next_seq_a =
> consulta_nextval($conn,$seq_a); $relleno = str_pad($next_seq_a, 6, "0", STR_PAD_LEFT);
> $nombre_archivo2 = $cod_unid_c.$relleno; if
> (is_uploaded_file($_FILES['anexo_elect'.$j]['tmp_name'])) {
> $bandera=move_uploaded_file($_FILES['anexo_elect'.$j]['tmp_name'],
> "anexos_r/".$nombre_archivo2); if($bandera) { $rs_ins3 = insertar($conn,
> "anexo_r","cod_unid, nro_anexo, nro_corr, ide_archivo, nob_archivo, tipo_archivo,
> des_archivo", $cod_unid_c.", ".$cont.", ".$val_seq_r2.",
> ".$nombre_archivo2.", ".$nombre_archivo.",
> '".$tipo_archivo."', ".$desc_archivo); } else { //echo "Error al subir
> el archivo";
> } } else { //echo "Archivo no válido"; }
> insertar no es más que una función que ejecuta el insert del sql
>
> El cuento es, que he logrado subir archivos sin extensión (texto plano), .txt , pero archivos
> con otros formatos, no...
>
> Como pueden ver, no estoy validando ni el tamaño ni el tipo de archivo, pues son
> requerimientos del cliente...
>
> Revisado los errores más comunes en gestión de archivos, en php.net, comparé con la
> configuración del apache:
>
> upload_max_filesize : 8M
> memory_limit : 64M
> max_execution_time : 30
> post_max_size : 8M
>
> también, según la documentación del propio move_uploaded_file, revisé:
>
> safe_mode : Off
> open_basedir : no value
>
> Alguna idea que me ayude a descartar el problema?
>
> Gracias de una
>
>
> Cesar A. Carbonara R.
> Usuario Linux 377997
> Debian Sarge
> www.gulmer.org.ve
>
> ---------------------------------
>
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>
>
> Cesar A. Carbonara R.
> Usuario Linux 377997
> Debian Sarge
> www.gulmer.org.ve
>
> ---------------------------------
>
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>
--
PHP Spanish Localization Talk Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Cesar A. Carbonara R.
Usuario Linux 377997
Debian Sarge
www.gulmer.org.ve
---------------------------------
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com