Re: Variable post as array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pieter du Toit wrote:
> I ran a print_r on it and this is the results
> 
> Array ( [txtPhoto] => Array ( [name] => g1.jpg [type] => image/pjpeg 
> [tmp_name] => /tmp/php3qkA4A [error] => 0 [size] => 17008 ) )
> 
> The image received here must be inserted into a database as binary it looks 
> like it.

"on it" is very vague dude. Be more specific... show code!!!

>From later posts it appears you are using register_globals to access the
file as if it is a local variable.

$txtPhotoData = addslashes(fread(fopen($txtPhoto, "r"),
filesize($txtPhoto)));

For file upload elements $txtPhoto will be an array. use
$txtPhoto['tmp_name'] or something. It's all in the manual.

PS just avoid register globals anyway, it's evil.

Col


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux