image file prob
| From: | John LYC | Date: | Tue, 27 Feb 2001 05:12:10 +0000 |
| Subject: | image file prob | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-41794@lists.php.net to get a copy of this message | ||
hi..
i have a form that allow users to upload several image files.
every time they submit, i do fread them and assign them to an array...
this array will be passed on until user confirmation.. then i insert
into database as blob type....
//freed image file and assign to array.
$diagram[$ind] =
addslashes(fread(fopen($HTTP_POST_FILES["QuestDia"]["tmp_name"][$ind],"r"),
//to facilitate posting of any existing array of the above to the next
form...
for($ind=0;$ind < count($diagram);$ind++)
print "<input type=\"hidden\" name=\"diagram[$ind]\"
value=\"".$diagram[$ind]."\">";
the script will bring user back to the form and allow them to upload
more...
the 2nd time round, i have got error..
i see parts of $diagram being displayed out... meaning funny characters
are displayed..
once $diagram is insert into database,,, the pic is corrupted..
it works fine if the form does not repeat.. meaning user post images and
database is updated straight away.
can someone tell me wat's wrong?
john