...

View Full Version : Problems uploading files on server farm



bcarl314
01-26-2004, 03:44 PM
I'm trying to upload some files using PHP to our webserver, which is a server farm of about 8 - 10 servers. Sometimes the upload works just fine and all is well, while other times, it seems as if the file is not uploaded.

Now, I know that these servers are replicated across each other, and the tmp.upload.dir is c:\tmp\phpupload.

Other things: I don't have direct access to the server to verify any files are being written to the tmp directory. So, I use is_uploaded_file to check and see if it's uploaded and if it is, copy to my location. The error I keep getting is a false return from is_uploaded_file. This, seems to tell me that the file is not being written to the tmp directory.

Now, usually, I'd think it could be a bug in my code (always my first thought because the admins don't like to be told it's on their end), but since it works sometimes and not others, I tend to rule out this problem.

Next, I thought it might be a network issue, so I asked other users to try to upload files. They experienced the same results. Sometimes it would upload, other times not.

I've even tried making a simple script using the code from the PHP.net site. Same issues.

Since this is a server farm, I'm wondering if it's because the c:\tmp\phpupload directory is actually a mapped directory and changes location during replication processes. Is that possible? Anyone have any ideas what might be causeing this?

Thanks

PS: Here's a sample of the code that causes problems. All looks good to me...



<html>
<body>
<?php
if (@is_uploaded_file($_FILES['uploadFile']['tmp_name'])) {
print $_FILES['uploadFile']['name']."<br />";
print $_FILES['uploadFile']['type']."<br />";
print $_FILES['uploadFile']['size']."<br />";
print $_FILES['uploadFile']['tmp_name']."<br />";
}
else {
print "No upload";
}
?>
</body>
</html>

coffeedemon
01-26-2004, 05:03 PM
How big are the files you are trying to upload? is the script timing out? Perhapps you are uploading files larger then the maximum allowed size? Do you get a error at all?

bcarl314
01-26-2004, 06:26 PM
Nope, it's not a file size issue, all the files are under 1MB. I'm getting the same errors I outlined in this (http://www.codingforums.com/showthread.php?s=&threadid=31421) thread.

Any ideas? At first I thought it was my code, but now I'm really thinking its a server thing.

sitami
01-27-2004, 12:24 AM
try setting your temp dir to the following

c:/tmp/phpupload


it may have something to do with apache and other things not recognising the \ instead use the unix standard path /


hope that helps :)

bcarl314
01-27-2004, 01:36 PM
Actually, the server farm is an IIS / Wintel system so the upload directory should be ok. The issue is sometimes it works and sometimesit doesn't. Which makes no sense to me.

Any other ideas?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum