file not uploaded to the wanted location

See all posts See thread Reply

Re: file not uploaded to the wanted location new!
by Rob Turner, 17 years, 5 months ago
He can write a one line php file that will display the phpinfo like:


As for the chroot environment, dunno what he's talking about as there's not something like that for PHP, so the answer would be no.

He may be thinking about safe mode though, as you know, php 4 is using safe mode, but php5 does not.

They could also be asking about open_base_dir which is common for upload gadgets, they need to use move_uploaded_file() instead of trying to read the temp directory directly. This is common for older scripts.

What error is he getting?Reply
Re: file not uploaded to the wanted location new!
by colin, 17 years, 5 months ago
Sometimes, PHP (Apache) can be installed in a chroot environment. Safe mode can also be used.

You're right about the open_base_dir although in any good setup, open_base_dir will actually include /tmp. If it is an open_base_dir issue, then there is a bit of code in the class that can be uncommented to use move_uploaded_file()Reply
Re: file not uploaded to the wanted location new!
by Tom, 17 years, 5 months ago
I uncommented the move_uploaded_file code and still got exactly the same result.

Here's a link to PHPinfo(): http://www.alphaselect.ca/locations/phpi.php

If you have any more suggestions that would be awesome.

Thanks,

TomReply
Re: file not uploaded to the wanted location new!
by colin, 17 years, 5 months ago
Try to comment the following lines:
$this->log .= '- ' . _("no image processing wanted") . '
'; if (!$this->no_upload_check) { $result = is_uploaded_file($this->file_src_pathname); } else { $result = TRUE; } if ($result) { $result = file_exists($this->file_src_pathname); if ($result) { $result = copy($this->file_src_pathname, $this->file_dst_pathname); if (!$result) { $this->processed = false; $this->error = _("Error copying file on the server. Copy failed"); } } else { $this->processed = false; $this->error = _("Error copying file on the server. Missing source file"); } } else { $this->processed = false; $this->error = _("Error copying file on the server. Incorrect source file"); }

and uncomment the following:
//$result = move_uploaded_file($this->file_src_pathname, $this->file_dst_pathname);
//if (!$result) {
//    $this->processed = false;
//    $this->error = _("Error copying file on the server");
//}

Then try uploading a file which is not an image (or an image, but with no image processing), and tell me if it works.Reply