Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts

    Problems uploading files on server farm

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

    Code:
    <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>

  • #2
    New Coder
    Join Date
    Oct 2003
    Location
    AZ
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    PHP | FreeBSD | MySQL |
    Check documentation... check documentation again and actually read it..do it... doesn't work ask.

  • #3
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Nope, it's not a file size issue, all the files are under 1MB. I'm getting the same errors I outlined in this thread.

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

  • #4
    New Coder
    Join Date
    Jan 2004
    Location
    UK
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •