Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Upload txt

Parašė WantedBoy· 2008 Bal. 6 18:04:30
#10

Ka pakeisti shiame faile kad keltu tik txt failus? O img nekeltu. Dabar kelia tik images ;)
<body>
<form name="form1" method="post" action="" enctype="multipart/form-data">
<input type="file" name="imagefile">
<br>
<input type="submit" name="Submit" value="Submit">
<?
if(isset( $Submit ))
{
//If the Submitbutton was pressed do:
if ($_FILES['imagefile']['type'] == "image/gif"){
   copy ($_FILES['imagefile']['tmp_name'], "statstxt/".$_FILES['imagefile']['name'])
   or die ("Could not copy");
      echo "";
        echo "Name: ".$_FILES['imagefile']['name']."";
        echo "Size: ".$_FILES['imagefile']['size']."";
        echo "Type: ".$_FILES['imagefile']['type']."";
        echo "Copy Done....";
 }
else {
        echo "<br><br>";
        echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>";
        }
}
?>
</form>
</body>




Redagavo WantedBoy· 2008 Bal. 6 18:04:48