Jump to content
php.lv forumi

upload ierobežošana!


ricshs

Recommended Posts

index.php

<form action="upload.php" method="post" enctype="multipart/form-data">

<input type="hidden" name="MAX_FILE_SIZE" value="70">

Select a file <input type="file" name="userfile"><br>

<input type="submit" value="Upload!">

upload.php

<?php

 

if(!(copy($_FILES['userfile']['tmp_name'], "Upload/" . $_FILES['userfile']['name']))) die("Cannot upload files.");

 

echo "Upload Complete!";

 

?>

Kā uztaisīt, lai varētu upot tikai .avi vai .mpeg failus ?

Link to comment
Share on other sites

×
×
  • Create New...