Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: file upload problems |
|
Author |
|
Eralde
Joined: 08 Aug 2007 Posts: 2
|
Posted: Wed 08 Aug '07 10:59 Post subject: file upload problems |
|
|
Today I installed Apache x64 and PHP 5 x64 for it
The problem is simpliest script(file_upload) works strangely:
#1 Upload_form
Code: |
<form action="upload.php" method="post" enctype="multipart/form data">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<input type="file" name="filename"><br>
<input type="submit" value="Загрузить"><br>
</form> |
#2 Script(upload.php)
Code: | <?
if($_FILES['filename']['error']==0)
{
$size = $_FILES['filename']['size'];
if($size > 0)
{
if(copy($_FILES["filename"]["tmp_name"],$_SERVER['DOCUMENT_ROOT']."/uploads/".$_FILES["filename"]["name"]))
{
echo("Файл успешно загружен <br>");
echo("Характеристики файла: <br>");
echo("Имя файла: ");
echo($_FILES["filename"]["name"]);
echo("<br>Размер файла: ");
echo($_FILES["filename"]["size"]);
echo("<br>Каталог для загрузки: ");
echo($_FILES["filename"]["tmp_name"]);
echo("<br>Тип файла: ");
echo($_FILES["filename"]["type"]);
}
else
{
echo "Ошибка копирования";
}
}
else
{
echo "Нулевой размер файла";
}
}
else
{
switch($_FILES['filename']['error'])
{
case 1: echo "Размер принятого файла превысил максимально допустимый размер.(php.ini)<br>";break;
case 2: echo "Размер принятого файла превысил максимально допустимый размер.<br>";break;
case 3: echo "Загружаемый файл был получен только частично.<br>";break;
case 4: echo "Файл не был загружен.<br>"; break;
}
}
?> |
#3 Fragments of php.ini
Code: |
file_uploads = On
upload_tmp_dir = E:\PHP_TEMP
upload_max_filesize = 209715200
...
max_execution_time = 3000 ; Maximum execution time of each script, in seconds
max_input_time = 6000 ; Maximum amount of time each script may spend parsing request data
|
I've got an error just trying to upload some file from server to itself...
The error code is 1.
But small files(500k) are copying fine.
Where should I search for roots of this problem? |
|
Back to top |
|
Eralde
Joined: 08 Aug 2007 Posts: 2
|
Posted: Wed 08 Aug '07 11:00 Post subject: |
|
|
I'm asking such a question here because this sccript works properly in Win32... |
|
Back to top |
|
|
|
|
|
|