Hi
I created a multi file upload form with save in database using php, javascript and flash.
The form allows users to select & upload multiple files using flash. The files are then sent to the server and saved to the database using php.
My problem is. The files are uploaded to the server OK. but stores array in the database eg
If uploades-
img01.jpg
img02.jpg
stores as in database-
array
array
Help!
CODE BELOW-
<?php
session_start();
echo ‘Upload result:<br>’;
$uploaddir = ‘userUploads/’;
$uploadfile = $uploaddir . basename(rand(1, 4000) . $_FILES[‘Filedata’][‘name’]);
echo ‘<pre>’;
if (move_uploaded_file($_FILES[‘Filedata’][‘tmp_name’], $uploadfile)) {
echo “File is valid, and was successfully uploaded.n”;
$uploadedfiles = ($
} else {
echo “Possible file upload attack!n”;
}
$files[] = $uploadedfiles;
foreach($files as $value)
{
$insert = “INSERT INTO testdata (testID, testImg, testImgId) VALUES (‘$testid’, ‘$value’, ‘$Idnum’)”;
mysql_select_db($database_img_conn, $img_conn);
mysql_query($insert) or die(mysql_error());
}
?>