0

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!

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by jamal_jarrar
0

hi all i wont someone to help me that i make system but am stop that i wont a code to prodram butoon to upload picture but i nee form style and the code please help me ... thnks..!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.