Jump to content

Please help for , file upload by php coding ....


arnabphp5

Recommended Posts

Hi ,

I am trying to upload file through php code................

 

if($_REQUEST['Submit']=='Submit')

{

 

  $filename=$_FILES['file']['name'];

  $dir='upload';

  echo "<br> ".$_FILES['file']['tmp_name'],$dir."/". $filename ;

// $uplod=copy($_FILES['file']['tmp_name'],$dir."/". $filename); 

  $uplod=move_uploaded_file($_FILES['file']['tmp_name'],$dir."/". $filename);

  if($uplod==1)

  {

    echo " <br> File upload successfull";

  }

  else

  {

    echo " <br> Sorry! File upload unsuccessfull";

  }

}

?>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

</head>

 

<body>

<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">

  <table width="100%" border="0">

    <tr>

      <td width="29%">Upload Image </td>

      <td width="71%"><input type="file" name="file" /></td>

    </tr>

    <tr>

      <td> </td>

      <td> </td>

    </tr>

    <tr>

      <td> </td>

      <td><label>

        <input type="submit" name="Submit" value="Submit" />

      </label></td>

    </tr>

  </table>

</form>

</body>

</html>

 

But this is not work in all server .

 

please help me ..........  need it as early as possible .

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.