Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

file upload

Empfohlene Antworten

Veröffentlicht

hab hier mein script und ich bekomms einfach nicht auf die reihe das file (die files) hochzuladen.


function uploadfiles( $aUploadFiles, $sUploadTargetFolder, $bExtractFiles) {
foreach ($aUploadFiles as $aFile) {
is_uploaded_file( $aFile);
$filename = substr($aFile,strrpos($aFile, "\\"));
move_uploaded_file( $aFile, $sUploadTargetFolder.$filename);
if (strtolower(substr( $aFile, -4))==".zip" && $bExtractFiles == "true") {
unzip( $aFile, $sUploadTargetFolder);
unlink( $aFile);
}
//if (!is_uploaded_file($aFile)) exit("upload fehlgeschlafgen");
}
}
[/PHP]

[code] <form action="index.php?uploadfiles" style="display:inline;" name="mainform" method="post" > <table> <tr> <td colspan="2"> <input type="file" name="uploadfiles[]" onchange="UpdateFileboxValue(this.name);"><br> <input type="file" name="uploadfiles[]" onchange="UpdateFileboxValue(this.name);"><br> <input type="file" name="uploadfiles[]" onchange="UpdateFileboxValue(this.name);"><br> <input type="file" name="uploadfiles[]" onchange="UpdateFileboxValue(this.name);"><br> <input type="file" name="uploadfiles[]" onchange="UpdateFileboxValue(this.name);"> <input type="hidden" name="MAX_FILE_SIZE" value="30000"> </td> </tr> </table> <input type=submit> </form> [/code]

die PHP funktion wird aufgerufen und läuft auch durch aber es findet kein "upload" statt.

Gruß

kills

Du brauchst ne spezielle Anweisung im Forumlar...hier mein Code:


<?php
if (isset($_FILES['upfiles']) and ! $_FILES['upfiles']['error']) {
move_uploaded_file($_FILES['upfiles']['tmp_name'], "user/images/$filename");
}
?>

<form enctype='multipart/form-data' action='$PHP_SELF' method='post'>
<table>
<tr>
<td colspan="2">
<input type="file" name="uploadfiles" onchange="UpdateFileboxValue(this.name);"><br>
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
</td>
</tr>
</table>
<input type=submit>
</form>
[/PHP]

Das wäre zumindest schon mal ein File. Um mehrere hochzuladen würde ich es mit ner Schleifen für den Upload versuchen und die Input-Felder noch hinzufügen.

Gruß

Tobi

nur mal ne frage, hast du auch die schreibrechte auf den ordner gepackt ? :D

kann ja sein, das es daran liegt ;)

nein daran lags nicht.

aber ich hab die lösung.

aus dem vorschlag aus dem 2. post habe ich entnommen das ich files nicht per $_POST sonder per $_FILES ansprechen muss.

danke für die mühe und viele Grüße

kills

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.