Hi
I'm also struggling with a simple upload. My settings are Tomcat 6.0.14, PHP 5.2.6 on Windows XP. I tried PHP 5.0.0 and 5.2.5 versions also,
The script is below
[CODE=html]<form enctype="multip art/form-data" action="upload. php" method="POST" >
<input type="hidden" name="MAX_FILE_ SIZE" value="300000" />
<input type="text" name="comment" value="" />
Send this file: <input name="userfile" type="file" />
<input type="submit" name="submit" value="Send File" />
</form>[/CODE]
File upload.php
[CODE=php]
<?php
$sub= $_POST['submit'];
$com= $_POST['comment'];
$uploaddir = '/uploads/';
$uploadfile = $uploaddir . basename($_FILE S['userfile']['name']);
echo 'Submit is '. $sub;
echo 'Comment is '.$com;
//phpinfo();
echo $uploadfile ;
echo '<pre>';
//if (move_uploaded_ file($_FILES['userfile']['tmp_name'], $uploadfile)) {
// echo "File is valid, and was successfully uploaded.\n";
//} else {
// echo "Possible file upload attack!\n";
//}
echo 'Here is some more debugging info:';
print_r($_FILES );
print "</pre>";
?>
[/CODE]
When I load a text file, the response is quick but no POST variable is registered. The output is
When I load a JPG file, it takes a long time (around 10min) to get back and a page error is showing.
The JPG file is only 80KB size. The php.ini file have the following settings
I've created the TMPDIR env variable pointing to an existing dir c:\temp
The uploads directory is created in the folder where the files are created. Full control on the directories are given to all users.
Any help will be appreciated.
I'm also struggling with a simple upload. My settings are Tomcat 6.0.14, PHP 5.2.6 on Windows XP. I tried PHP 5.0.0 and 5.2.5 versions also,
The script is below
[CODE=html]<form enctype="multip art/form-data" action="upload. php" method="POST" >
<input type="hidden" name="MAX_FILE_ SIZE" value="300000" />
<input type="text" name="comment" value="" />
Send this file: <input name="userfile" type="file" />
<input type="submit" name="submit" value="Send File" />
</form>[/CODE]
File upload.php
[CODE=php]
<?php
$sub= $_POST['submit'];
$com= $_POST['comment'];
$uploaddir = '/uploads/';
$uploadfile = $uploaddir . basename($_FILE S['userfile']['name']);
echo 'Submit is '. $sub;
echo 'Comment is '.$com;
//phpinfo();
echo $uploadfile ;
echo '<pre>';
//if (move_uploaded_ file($_FILES['userfile']['tmp_name'], $uploadfile)) {
// echo "File is valid, and was successfully uploaded.\n";
//} else {
// echo "Possible file upload attack!\n";
//}
echo 'Here is some more debugging info:';
print_r($_FILES );
print "</pre>";
?>
[/CODE]
When I load a text file, the response is quick but no POST variable is registered. The output is
Code:
Submit is Comment is /uploads/ Here is some more debugging info:Array ( )
When I load a JPG file, it takes a long time (around 10min) to get back and a page error is showing.
The JPG file is only 80KB size. The php.ini file have the following settings
Code:
file_uploads = On upload_max_filesize = 10M upload_tmp_dir =
The uploads directory is created in the folder where the files are created. Full control on the directories are given to all users.
Any help will be appreciated.
Comment