|
Posted by Chung Leong on 11/18/88 11:43
comp.lang.php wrote:
> Consider my code:
>
> [PHP]
> if ($this->isSuccessful &&
> is_file($_FILES['uploaded_resume_path']['tmp_name'])) { //
> STEP 6: MOVE RESUME TO DIRECTORY
> $uuid = $this->sfug->getUUID();
> if (!$uuid) $this->sfug->setUUID();
> $uuid = $this->sfug->getUUID();
>
> print_r(is_uploaded_file($_FILES['uploaded_resume_path']['tmp_name']));
> error_reporting(E_ALL);
> move_uploaded_file($_FILES['uploaded_resume_path']['tmp_name'],
> actual_path("$resumeBasePath/$uuid/" .
> $_FILES['uploaded_resume_path']['name'])); // realpath() FAILS UNLESS
> FILE EXISTS
> if (!is_file(actual_path("$resumeBasePath/$uuid/" .
> $_FILES['uploaded_resume_path']['name']))) {
> list($moveKommand, $moveRedirect) =
> @array_values($this->getKommandOSArray('move'));
> $msg = exec("$moveKommand \"" .
> $_FILES['uploaded_resume_path']['tmp_name'] . '" "' .
> actual_path("$resumeBasePath/$uuid/" .
> $_FILES['uploaded_resume_path']['name']) . "\" $moveRedirect");
> if ($msg || !is_file(actual_path("$resumeBasePath/$uuid/" .
> $_FILES['uploaded_resume_path']['name']))) {
> $this->isSuccessful = false;
> $this->setErrorArray(array('uploaded_resume_path' => 'Was unable
> to store uploaded resume: ' . nl2br($msg)));
> }
> }
> }
> error_reporting(E_ALL && ~E_NOTICE);
> [/PHP]
>
> Upon testing I found that is_uploaded_file() is set to TRUE, but
> move_uploaded_file() fails, no errors, no warnings, nothing, it just
> completely fails to move the file, even though it is proven to not only
> exist but is findable.
>
> What could cause something like that to occur?
>
> Thanx
> Phil
Are you running in safe-mode or using open_basedir? If restrictions
imposed by either of these is preventing the move, move_uploaded_file()
would fails without emitting an error.
[Back to original message]
|