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.

[PHP] nach upload...

Empfohlene Antworten

moin

nachdem ich mit dem folgenden script dateien auf den server geladen habe, kann ich sie nicht mehr löschen ! warum? liegt das am script?


<form
action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post"
enctype="multipart/form-data">
<p> Pfad:         
<input type="file" name="probe" />
</p>
<p> Dateiname:
<input name="name" type="text" id="name2">
</p>
<p>
<select name="rubrik" id="select">
<option>- - Rubrik - - </option>
<option value="../../daten/1/">1</option>
<option value="../../daten/2/">2</option>
<option value="../../daten/3/">3</option>
</select>
</p>
<p>
<input name="submit" type="submit" value="Hochladen" />
</p>
</form>
<hr />
<?php
if (isset($_FILES['probe']) and ! $_FILES['probe']['error']) {
// Alternativ: and $_FILES['probe']['size']
move_uploaded_file($_FILES['probe']['tmp_name'], "$rubrik $name");
printf("Die Datei %s steht jetzt als " .
"$name zur Verfügung.<br />\n",
$_FILES['probe']['name']);
printf("Sie ist %u Bytes groß und vom Typ %s.<br />\n",
$_FILES['probe']['size'], $_FILES['probe']['type']);
}
?>
[/PHP]

das wird wohl daran liegen weil das system dann owner von den dateien ist. musst nur die chmods von den dateien ändern, dann sollte es wieder gehn

wenn ich versuche das attribut zu ändern kommt ne nur ne fehlermeldung!

und ich will sie von ftp oder script löschen

Hi!

Ich geh mal davon aus das dein Webserver auf Linux läuft:

Das System ist eher nicht der Besitzer der Datei sondern der Nutzer "wwwrun"!

(Der User "wwwrun" ist eigentlich dann "aktiv", wenn du mit dem Browser auf dem Webserver zugreifst!)

Die Datei kann somit eigentlich nur noch root löschen! Du müsstest schon während

das Script abläuft ein "chmod" durchführen dann kannst du sie auch ganz beliebig mit ihr verfahren!

Gruß

Azrael

Also solche probleme hatte ich ab und zu auch schon. Als zuverlässigste Methode hat sich folgende Funtion herausgestellt (hab zumindest noch keine bessere gefunden)


function delete_file($file)
{
$delete = @unlink($file);
clearstatcache();
if (@file_exists($file))
{
$filesys = eregi_replace("/","\\",$file);
$delete = @system("del $filesys");
clearstatcache();

if (@file_exists($file))
{
$delete = @chmod ($file, 0775);
$delete = @unlink($file);
$delete = @system("del $filesys");
}
}
clearstatcache();
if (@file_exists($file))
{
return false;
}
else
{
return true;
}
} // end function

[/PHP]

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.