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



Relevant Pages

  • Re: Editing HTML in publisher
    ... In the browser go to Help and then About IE or FF or whatever the name of the browser, ... Assuming that you are using FireFox or some other browser than IE, the reason the links are not working is that all the text has been converted to images, which kills the links. ... I suspect the reason you are getting these images is because you have grouped together those design elements. ... changing upon new upload. ...
    (microsoft.public.publisher.webdesign)
  • Re: upload word doc in asp.net
    ... If you're using a browser there is not much you can do as the Upload/Browse ... But this won't be an easy task and of course require messy ActiveX ... > so that the user can use Microsoft Word to modify the document. ... my problem is to upload the document in the server without too ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [Full-Disclosure] Friendly and secure desktop operating system
    ... >> download them. ... > And even then you can't do a good job of keeping the main browser from lying to ... - You have a File Open/Save service process that has access to all files ... - Web browser's Upload function makes an IPC call to File Open/Save ...
    (Full-Disclosure)
  • Re: Directory Upload
    ... "Chow" wrote in message ... > project or for my work, but I did file upload tool recently, and it ... > application without using any applets. ... I've never seen this implemented by any browser. ...
    (comp.lang.java.programmer)
  • Re: Directory Upload
    ... "Chow" wrote in message ... > project or for my work, but I did file upload tool recently, and it ... > application without using any applets. ... I've never seen this implemented by any browser. ...
    (comp.lang.java.help)