This is a discussion on Uploading Large Files - Strange Issue within the PHP General forums, part of the PHP Programming Forums category; Hello group, I have a very strange issue coming up when uploading large files ( about 30MB). The problem is it ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello group,
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. Thank you. Anna Vester |
|
|||
|
[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? |
|
|||
|
[snip]
-----Original Message----- From: Jay Blanchard [mailto:jblanchard@pocket.com] Sent: Wednesday, August 06, 2008 9:44 PM To: Anna Vester; php-general@lists.php.net Subject: RE: [php] Uploading Large Files - Strange Issue 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? [/snip] He is using IE7 on Vista, he has a number of fishing add-ons (I don't remember which exactly since I've seen his laptop only once before this problem arose). Also he's been using "You send it" service just fine. That's what bums me! Thanks for such a quick response. Anna |