Answer the question
In order to leave comments, you need to log in
Why can't I save the file from the form?
Hello!
Needed but doesn't work:
<?php
print "Размер в байтах принятого файла. - " . $_FILES["userfile"]["size"] . "<br>";
print "MIME тип файла - " .$_FILES["userfile"]["type"] . "<br>";
print "Временное имя, с которым принятый файл был сохранен на сервере. - " .$_FILES["userfile"]["tmp_name"] . "<br>";
print "<hr>";
print "Возника ошибка номер " . $_FILES["userfile"]["error"] . "<br>";
$uploaddir = __DIR__.'/files';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)){
print "Загрузка была завершена успешно.";
}else{
print "Произошел какой-то треш при загрузке файла";
}
?>
The size in bytes of the received file. - 1329
MIME file type - text/html The
temporary name with which the received file was saved on the server. - C:\OpenServer\userdata\temp\phpDDAB.tmp
------------------------------- -------------------------------------------------- ------------------
Error number 0 occurred The
download was completed successfully.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question