Jump to content
php.lv forumi

Nevar upload failus (tikai teksta)


MārisL

Recommended Posts

Lieta tāda, ka lietojot šos kodus

 

-----------------------------------------------------------------------------------------------------------------

 

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

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

Fails: (max: 2mb) <input type="file" name="userfile"><br>

<input type="submit" value="Pievienot">

 

un

 

 

<?php

 

if(!(copy($_FILES['userfile']['tmp_name'], "Upload/" . $_FILES['userfile']['name']))) die("Failu nav iespējams pievienot!");

 

echo "<br>Pievienošana pabeigta!<br><br>";

 

?>

 

-----------------------------------------------------------------------------------------------------------------

 

Viņš atļauj tikai uplaod teksta failus (txt, html, php, etc.)

 

Kāds nevarētu zināt, kas par lietu?

Link to comment
Share on other sites

×
×
  • Create New...