RE: [PHP] Uploading Large Files - Strange Issue
- From: jblanchard@xxxxxxxxxx ("Jay Blanchard")
- Date: Wed, 6 Aug 2008 21:43:30 -0500
[snip]
I have a very strange issue coming up when uploading large files ( about
30MB). The problem is it works fine on my computer (and two others that
I've
tested), but it doesn't work on my client's laptop. It comes up with
error
code - 0 (which is upload successful), but the actual file is not on the
server. Here is my error checking code:
if ($sizeOK && $typeOK) {
switch($_FILES['items']['error'][$number]) {
case 0:
if(!file_exists(UPLOAD_DIR.$file)) {
$success =
move_uploaded_file($_FILES['items']['tmp_name'][$number],
UPLOAD_DIR.$file);
}
else {
$success =
move_uploaded_file($_FILES['items']['tmp_name'][$number],
UPLOAD_DIR.$postDate.$file);
$cp = true;
}
if ($success) {
$result[] = "$file uploaded
successfully";
}
else {
$result[] = "Error uploading $file.
Please
try again.";
}
break;
case 3:
$result[] = "Error uploading $file. Please try
again.";
default:
$result[] = "System error uploading $file.
Contact
Webmaster.";
}
}
elseif ($_FILES['items']['error'][$number] == 4) {
$result[] = 'You chose not to add this file.';
}
else {
$result[] = "$file cannot be uploaded. Maximum size: $max.<br />
Acceptable file types: pdf and mp3.<br />Error number: " .
$_FILES['items']['error'][$number]."<br />";
}
=====================================
So for some reason on his computer it doesn't go to the switch statement
(case 0), but goes to the very last else statement.
So he always get this message:
bigfiles.mp3 cannot be uploaded. Maximum size: 51,000.00KB.
Acceptable file types: pdf and mp3
Error number: 0
Yet, it always seems to work when I do it on my computer.
Any insight into this issue would be very helpful.
[/snip]
It is likely that it is not PHP causing the issue. What browser is he
using? What are his security settings for the browser? Have you viewed
the source of the upload form on his browser?
.
- Follow-Ups:
- RE: [PHP] Uploading Large Files - Strange Issue
- From: "Anna Vester"
- RE: [PHP] Uploading Large Files - Strange Issue
- References:
- Uploading Large Files - Strange Issue
- From: "Anna Vester"
- Uploading Large Files - Strange Issue
- Prev by Date: Re: [PHP] Re: Version Control Software
- Next by Date: RE: [PHP] Uploading Large Files - Strange Issue
- Previous by thread: Uploading Large Files - Strange Issue
- Next by thread: RE: [PHP] Uploading Large Files - Strange Issue
- Index(es):
Relevant Pages
|