Nahrávanie a správa súborov ukážka v PHP
<?php /** * @author sczdavos * @site www.itnetwork.cz */ header('Content-type: text/html; charset=utf8'); if (isset($_FILES['image_'])) { $imagesCount = count($_FILES['image_']['name']); for ($i = 0; $i < $imagesCount; $i++) { if (move_uploaded_file($_FILES['image_']['tmp_name'][$i], 'files/' . $_FILES['image_']['name'][$i])) echo('nahráno'); else echo('chyba'); } } if (isset($_POST['del'])) { foreach ($_POST['del'] as $file) { if (unlink('files/' . $file)) echo($file . ' smazáno'); else echo($file . ' nepodařilo se smazat'); } } echo(' <form method="post" name="file_upload" enctype="multipart/form-data"> <input type="file" multiple="" size="26" name="image_[]" /><br /> <input type="submit" name="upload_imgs" value="Nahrát" /> </form>'); echo('<form method="post" name="evidence"> <table> <tr> <th> </th><th>soubor</th> </tr>'); $dir = 'files/'; if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if ((is_dir($dir)) && (strlen(str_replace('.', '', $file)) > 0)) { echo(' <tr> <td><input type="checkbox" name="del[]" value="' . $file . '"</td> <td><a href="' . $dir . $file . '" style="color: blue;">' . $file . '</a></td> </tr> '); } } closedir($dh); } echo('</table> <input type="submit" name="delete" /> </form>');