xampp dan yüklenen dosyaları okumak nasıl

1 Cevap php

Ben sunucudaki dosyaları yüklemek için bu kodu vardır:

<tr>
<td>
<form enctype="multipart/form-data" action="uploadaction.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
</td>
</tr>
<tr>
<td>
Select the image: <input name="uploadedfile" type="file" />

</td>
<tr>
<td>
<input type="submit" value="Upload File" />
</form>
</td>
</tr>

Ve burada eylem biçimi var:

<?php
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}
?>

What php function will I use? Can you give me an example on how to read the file back and display it in the browser? Please help, thanks.

1 Cevap

PHP's documentation about file uploads sorunu çözmek gerekir. Öyle değil ve hala bu konuda bir sorunuz varsa, geri gelip tekrar sormaya çekinmeyin.