Bluehost.com Web Hosting $6.95

Uploading Large Files - Strange Issue

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-07-2008
Anna Vester
 
Posts: n/a
Default Uploading Large Files - Strange Issue

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


Reply With Quote
  #2 (permalink)  
Old 08-07-2008
Jay Blanchard
 
Posts: n/a
Default RE: [PHP] Uploading Large Files - Strange Issue

[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?
Reply With Quote
  #3 (permalink)  
Old 08-07-2008
Anna Vester
 
Posts: n/a
Default RE: [PHP] Uploading Large Files - Strange Issue

[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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0