Hey, ich bin gerade dabei eine Homepage zu erstellen wo ich Dateien hoch und runter laden kann. Also ich upload z.b ein file Bild, Word Dokument usw... Und es wird automatisch auf den Webserver gespeichert und ich kann es in Filezilla abrufen.
Ein upload script habe ich schon wo funktioniert, aber ich benoetige ein downlaod script. Das bedeutet wo ich in der homepage auf meine daten in filezilla zugreifen kann und sie runterladen kann.
Ich hoffe jemand kann mir helfen, freue mich ueber jede Hilfe.
THX schonmal :)
Upload script:
<?php$result=0;
if (trim($_POST["action"]) == "Upload File") { //**** User Clicked the Upload File Button
//*********** Execute the Following Code to Upload File *************
$imagename = basename($_FILES['image_file']['name']); // grab name of file
$result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $imagename); // upload it
if ($result==1) echo("Successfully uploaded: <b>".$imagename."</b>"); // did it work?
} // end if
?>
<html>
<head>
<title>Upload file script</title>
</head>
<body>
<form method='POST' enctype='multipart/form-data' name='frmmain' action='uploadfile.php'>
Browse for Image (jpg): <input type="file" name="image_file" size="35">
<br>
<input type="submit" value=" Upload File " name="action">
</form>
<br>
<?php
if ($result==1) echo("<img src='".$imagename."'>"); // display the uploaded file
?>
</body>
</html>
Ein upload script habe ich schon wo funktioniert, aber ich benoetige ein downlaod script. Das bedeutet wo ich in der homepage auf meine daten in filezilla zugreifen kann und sie runterladen kann.
Ich hoffe jemand kann mir helfen, freue mich ueber jede Hilfe.
THX schonmal :)
Upload script:
<?php$result=0;
if (trim($_POST["action"]) == "Upload File") { //**** User Clicked the Upload File Button
//*********** Execute the Following Code to Upload File *************
$imagename = basename($_FILES['image_file']['name']); // grab name of file
$result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $imagename); // upload it
if ($result==1) echo("Successfully uploaded: <b>".$imagename."</b>"); // did it work?
} // end if
?>
<html>
<head>
<title>Upload file script</title>
</head>
<body>
<form method='POST' enctype='multipart/form-data' name='frmmain' action='uploadfile.php'>
Browse for Image (jpg): <input type="file" name="image_file" size="35">
<br>
<input type="submit" value=" Upload File " name="action">
</form>
<br>
<?php
if ($result==1) echo("<img src='".$imagename."'>"); // display the uploaded file
?>
</body>
</html>