Re: Re: File Upload Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there already a file with the same name?
Apparently copy won't overwrite a file on windows if it already exists.

Maybe you have the same problem ffproberen2 at dodgeit dot com had on
the php.net/move_uploaded_file manpage?

2011/4/10 tedd <tedd.sperling@xxxxxxxxx>:
> At 7:15 AM +0200 4/7/11, Wojciech Kupiec wrote:
>>
>> On 06/04/11 19:10, tedd wrote:
>>>
>>> -snip-
>>> What could be wrong? What should I be looking for?
>>
>> If you really want to get help, publish your code.
>
> I don't think that's true. I should be able to ask a technical question with
> observations and inquire as to "What's wrong?" After all, what's the point
> of showing code that works on two servers, but fails on a third? Really,
> what is that going to tell you?
>
> As for the uploaded file exceeding "max file size" and "file_uploads"
> enabled, those are obvious and I did that investigation before I posted the
> question. They are NOT the problem.
>
> I also checked all the servers involved for "safe_mode" and "open_basedir"
> settings and they are set the same. Additionally, the "upload_max_filesize"
> and "upload_tmp_dir" are also set exactly the same. As such, I don't know
> what else to look for -- hence my question.
>
> As I said, the script works on two servers, but fails on a third.
>
> This is what I've learned in addition to the above:
>
> The script does successfully upload the file to the server in question. For
> example, I receive "truth" from:
>
> if(is_uploaded_file($_FILES['userfile']['tmp_name']))
> Â {
> Â echo('true');
> Â }
>
> I can even get the contents of the uploaded file by:
>
> $contents = file_get_contents($_FILES['userfile']['tmp_name']);
> echo($contents);
>
> -- and the contents are displayed.
>
> So, the file is indeed uploaded!
>
> What I cannot do is move the file to another location using:
>
> $result = move_uploaded_file($_FILES['userfile']['tmp_name'], $path . '/' .
> $_FILES['userfile']['name']);
>
> (Yes, all possible file paths have been investigated)
>
> Nor, can I copy the file by:
>
> $result = copy($_FILES['userfile']['tmp_name'], $path . '/' .
> $_FILES['userfile']['name']);
>
> The only difference I see is the server causing problems is Windows NT
> whereas the others are Linux.
>
> So, knowing this Â-- does anyone have any idea as to what is wrong?
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux