Ben php bir liste kutusundan dosya yüklemek istiyorum.
I <input type="file"> ki ben http://www.tizag.com/phpT/fileupload.php bulunan kullanarak bunu yapmak mümkün duyuyorum
Ama ben <select> bu <input type="file"> değiştirdiğinizde
ben bu şekilde çalışıyorum
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" />
<select name="uploadedfile" id = "fileName" size="3" style="width: 100%">
<option id = "uploadedfile" value="c:\text.txt">c:\text.txt</option>
</select>
<input type="submit" value="Upload File" />
</form>
ve PHP kodu her iki durumda aynı kalır
<?php
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['value']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['value']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
çalışmıyor ........
Regards Hemant