File Upload - Dwindling connection
| From: | Andre Dubuc | Date: | Wed, 30 Oct 2002 10:05:21 +0000 |
| Subject: | File Upload - Dwindling connection | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122135@lists.php.net to get a copy of this message | ||
I'm having big problems with uploading jpeg pictures from a calling form.
What happens is that the htpps connection begins (usaully at a very low
transfer rate -- somewhere around 900 b/s, and then dwindles rapidly to 200 -
20 -10 b/s). The file doesn't appear in the upload or temp directory (file
size was in the test case 500 bytes).
I've properly encoded the page:
<form action="pix-upload.php" method="post"
enctype="multipart/form-data">
The actual upload code is placed almost at the beginning of the page (just
after calling session_start).
The code:
<?php
if ($_FILES['pix']['size'] > 0) {
if ($_FILES['pix']['type'] == "image/jpeg") {
$pix_file = $_FILES['pix'][name];
$pix_temp_file = $_FILES['pix']['temp_name'];
$new_pix_file = "{$_SESSION['rid']}-{$_SESSION['sid']}.jpg";
if(is_uploaded_file($pix_temp_file)) {
move_uploaded_file($pix_temp_file, "pix_holding/$new_pix_file");
copy("pix_holding/$new_pix_file", "pix/$new_pix_file");
}
}
}
?>
Any ideas what what might cause a connection to dwindle and die like this? I
can upload/download anywhere else except with this code. I'm using a Unix
box, as well s my IP. Directory/file permissions are OK and set to 755.
Tia, Andre