By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,182 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,182 IT Pros & Developers. It's quick & easy.

move_uploaded_file problem on Mac

P: n/a
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.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
pa**@popimages.com (Paul Lamonby) wrote in message news:<86**************************@posting.google. com>...
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?


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
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.