Hi buddy,
I have small script which upload the images. This script is working perfectly fine in
localhost but when I upload that script to my website then it is not uploading the pictures.
I have subdomain in my website names as http://projects.abc.com,
In projects folder I have my photo upload script.
Here I add some code from my file.
$numfilesuploaded = $_POST['numuploads'];
$count = 1;
while ($count <= $numfilesuploaded)
{
$conname = "new_file".$count;
$filetype = $_FILES[$conname]['type'];
$filename = $_FILES[$conname]['name'];
if ($filename != '')
{
if ($filetype == "image/x-png" || $filetype == "image/pjpeg" ||
$filetype == "image/gif" || $filetype == "image/jpeg")
{
$maxfilesize = $_POST['maxsize'];
$filesize = $_FILES[$conname]['size'];
if($filesize <= $maxfilesize )
{
$randomdigit = rand(0000,9999);
$newfilename = $randomdigit.$filename;
$source = $_FILES[$conname]['tmp_name'];
$target = "upload/project/".$newfilename;
move_uploaded_file($source, $target);
$sql_update =
"UPDATE project SET
photo".$count." = '".$newfilename."',
modified_date = now()
WHERE project_id = '".$str_project_id."' ";
tep_db_query($sql_update,
$conn);
}
else
{
echo $count." File is too big! 10MB limit! |";
}
}
else
{
echo " The file is not a supported type |";
}
}
$count = $count + 1;
}
If you have some sort of solution then please help me.
Thanks for read my post!