jQuery: The Write Less, Do More JavaScript Library

whats wrong with my php upload?

View: New views
1 Messages — Rating Filter:   Alert me  

whats wrong with my php upload?

by Jubaida :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Hi guys...


i am using the jquery plugin for uploading mulitple files using php. Don't understand whats wrong with my code... is it i am not using the array properly or something? Plz help............

Here is the code..................................................................................................................

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<?

import_request_variables("PC", "my_");

if($my_doit=="now"){

        //for Download file
        $target = "news/";
        $target = AddSlashes("news/");

if ($_FILES["file1[]"]["error"] > 0)
  {
  echo "Error: " . $_FILES["file1[]"]["error"] . "<br />";
  }
else
  {
  echo "Upload: " . $_FILES["file1[]"]["name"] . "<br />";
  echo "Type: " . $_FILES["file1[]"]["type"] . "<br />";
  echo "Size: " . ($_FILES["file1[]"]["size"] / 1024) . " Kb<br />";
  echo "Stored in: " . $_FILES["file1[]"]["tmp_name"];

  }
       
        $target = $target . basename( $_FILES['file1[]']['name']) ;
       
        echo $target;
        $f1=$_FILES['file1[]']['name'];


        if(move_uploaded_file($_FILES['file1[]']['tmp_name'], $target))

        {


                $fsuc= basename( $_FILES['file1[]']['name']);
echo $fucus;

        }


        else {


                $fucus= basename( $_FILES['file1[]']['name']) ;
echo $fucus;
        }
}


?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="images/jquery-latest.js" type="text/javascript" language="javascript"></script>
<script src="images/jquery.MultiFile.js" type="text/javascript" language="javascript"></script>

<title>Untitled Document</title>
<link href="admin/images/jquery.MultiFile.js" rel="stylesheet" type="text/css" />
</head>

<body>
<form enctype="multipart/form-data" action="" method="POST">
<input type="file" name="file1[]"  class="multi" />
<input type="hidden" name="doit" value="now" />
<input type="submit" value="Upload File" />

</form>
</body>
</html>
LightInTheBox - Buy quality products at wholesale price