HiHo,
Ich versuche gerade ein Script zu Basteln das es mir ermöglicht mehrere Files per PHP hochzu laden.
Bei einer Datei läuft es ohne Probleme, bei 2 oder mehr schlägt es fehl.
Habt ihr da einen Tip?
Alles anzeigen
Alles anzeigen
Ich versuche gerade ein Script zu Basteln das es mir ermöglicht mehrere Files per PHP hochzu laden.
Bei einer Datei läuft es ohne Probleme, bei 2 oder mehr schlägt es fehl.
Habt ihr da einen Tip?
Quellcode
- if ( isset($_FILES['file']) && !empty($_FILES['file']['name']) )
- {
- if (!empty($_FILES['file_thumb']['name']) )
- {
- $extension = $_FILES['file_thumb']['name'];
- $thumbname = 'img_' . time() . '_' . rand(0,9999) . '.' . $extension;
- $bdirl = dirname($Core->get(GETSERV, 'SCRIPT_FILENAME')) . '/modules/videos/images/';
- @move_uploaded_file($_FILES['file']['tmp_name'], $bdirl . $thumbname);
- @chmod($bdirl . $thumbname, 0777);
- }
- else
- {
- $thumbname = 'default.png';
- }
- $rand_name = 'vid_' . time() . '_' . rand(0,9999) . '.flv';
- $bdir = dirname($Core->get(GETSERV, 'SCRIPT_FILENAME')) . '/modules/videos/';
- @move_uploaded_file($_FILES['file']['tmp_name'], $bdir . $rand_name);
- @chmod($bdir . $rand_name, 0777);
- }
Quellcode
- <form enctype="multipart/form-data" action="index.php?mode=video_gallery&sub=upload&id={$CAT_ID}" method="post">
- <div class="ucp_container">
- <table width="100%" border="0" cellspacing="1" cellpadding="1">
- <tr>
- <td><strong>{$LANG.AUSWAHL}:</strong></td>
- <td><input id="gfuploader" type="file" name="file" /></td>
- </tr>
- <tr>
- <td><strong>{$LANG.AUSWAHL}:</strong></td>
- <td><input id="gfuploader1" type="file" name="file_thumb" /></td>
- </tr>
- <tr>
- <td><strong>{$LANG.TITLE}:</strong></td>
- <td><input type="text" name="title" class="field_fs" value="" /></td>
- <tr>
- <td><strong>{$LANG.DESC}:</strong></td>
- <td><input type="text" name="desc" class="field_fs" value="" /> </td>
- </tr>
- <tr>
- <td class="row1" colspan="2" align="right"><input type="submit" name="save" value="{$LANG.SEND}" class="button_green" /></td>
- </tr>
- </table>
- <div class="ucp_clear"></div>
- </div>
- </form>