Connecting Tech Pros Worldwide Help | Site Map

move_uploaded_file problem on Mac

Paul Lamonby
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi,

I am using Mac os10.3.3, running Apache and PHP 4.3.6
I am just starting to use my local Sites folder to test php for my
sites, but I cannot seem to get move_uploaded_file() or copy() to
work.
I assumed it was a file path error, but after trying every possible
file path combination, I dont think it is. I feel I have not done
something to php or apache to handle moving files locally.

Example:
<?PHP
$path = '/Users/myname/Sites/uploads/';
$file_name = $_FILES['file']['name'];
$temp_name = $_FILES['file']['tmp_name'];
$new_path = $path . $file_name;
move_uploaded_file($temp_name, $new_path);
?>

Firstly, is there anything I have done wrong with this code?
Has anyone had this problem before?
I appreciate any help.
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#2: Jul 17 '05

re: move_uploaded_file problem on Mac


paul@popimages.com (Paul Lamonby) wrote in message news:<86406024.0405111434.1ee4add0@posting.google. com>...[color=blue]
> Hi,
>
> I am using Mac os10.3.3, running Apache and PHP 4.3.6
> I am just starting to use my local Sites folder to test php for my
> sites, but I cannot seem to get move_uploaded_file() or copy() to
> work.
> I assumed it was a file path error, but after trying every possible
> file path combination, I dont think it is. I feel I have not done
> something to php or apache to handle moving files locally.
>
> Example:
> <?PHP
> $path = '/Users/myname/Sites/uploads/';
> $file_name = $_FILES['file']['name'];
> $temp_name = $_FILES['file']['tmp_name'];
> $new_path = $path . $file_name;
> move_uploaded_file($temp_name, $new_path);
> ?>
>
> Firstly, is there anything I have done wrong with this code?
> Has anyone had this problem before?[/color]

Try adding the following two lines in the beginning of all your scripts:

error_reporting(E_ALL);
ini_set('display_errors', 1);

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Closed Thread