473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

move_uploaded_file problem on Mac

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
1 4942
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: neo002244 | last post by:
The move_uploaded_file() function is very quirky. I want to allow users to upload images to the Web site. Here is the code: if(!move_uploaded_file($_FILES, $imagefile)) { die("Could not move...
1
by: Felix Natter | last post by:
hi, I would like to upload a file (via a form), then read that (temporary) file and write the contents into a database. The first problem is that open_basedir=/home/CUSTOMER so I can't just read...
1
by: sa | last post by:
Trying to upload a file using win xp/iis/php. I've given full access to all accounts trying to get this to work? Yet I'm still getting read errors. Simplified the script below to the bare...
6
by: Stijn Goris | last post by:
HI all, I have created a script that allows a user to upload a picture. I have an IIS server runing on my own pc but the actual site runs an Apache server. The upload script worked perfectly on...
2
by: Brian | last post by:
Hi I am moving a site to a new server, I have been testing it and one of the pages uses move_uploaded_file, but I get a Permission denied. The directory I am moving it to is chomd of 755, if...
1
by: comp.lang.php | last post by:
Consider my code: if ($this->isSuccessful && is_file($_FILES)) { // STEP 6: MOVE RESUME TO DIRECTORY $uuid = $this->sfug->getUUID(); if (!$uuid) $this->sfug->setUUID(); $uuid =...
5
by: bill | last post by:
I can validate that the file uploaded because is_uploaded_file() returns true. --------- if (is_uploaded_file($_FILES)) { echo "File ". $_FILES ." uploaded successfully.<br />"; }...
7
by: nicemotion | last post by:
Hi all, the following easy script correctly insert a record in the DB but is not moving the images (Logo and Foto) to the server /foto folder. can't understand why 'cause the script is easy...
3
by: groupie | last post by:
Hi, The code below is working - it returns the 'Received' message, however I cannot find the uploaded file in the destination folder, or anywhere else (other than source directory). I'm running...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.