Jump to content
php.lv forumi

file upload


Jee

Recommended Posts

Kaa es varu uploadot atveertu mapi? Piemeeram man ir mape galerija, un zem mapes galerija ir apaksmapes. Un tajaas mapees ir php fails kursh uploado sho mapi!

Link to comment
Share on other sites

Es ne taa paprasiju! Piemeeram man ir mape galerija un tur mape tests. Ieksh mapes tests staav php fails ar shaadu kodu:

if ($_GET[upload]=="true") {
  @copy($_FILES[fails][tmp_name], "galerija/tests/".$_FILES[fails] [name]);

     echo"Fails pievienots!";


     }

   elseif(!isset($_GET[upload])) {
      echo"
<form method=\"post\" action=\"upload.php?upload=true\" enctype=\"multipart/form-data\">
<p><strong>Noradit failu:</strong><br>
<input type=\"file\" name=\"fails\" size=\"30\"></p>
<input type=\"text\" name=\"name\">
 <p><input type=\"submit\" name=\"submit\" value=\"Pievienot Failu!\"></p>
</form>";
}

NU es gribeeju zinaat, kas ir jaaraksta galerija/tests vietaa, lai shis php fails uploadot to mapi kuraa vinjsh atrodas!

Link to comment
Share on other sites

manupraat tu uzpraiiji to pashu, ko ieprieksh.

 

mapes nevar caur <input type=file/> uzlaadeet.

 

caur katru inputu var tikai vienu failu, ja gribi vairaakus taisi vairaakus inputus vai domaa citu sisteemu,

Link to comment
Share on other sites

×
×
  • Create New...