PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
eyal
Forum Newbie
Posts: 19 Joined: Mon Jun 19, 2006 11:03 am
Post
by eyal » Sat Nov 11, 2006 7:17 am
Hello,
How do you I upload a file for a folder which is in upper then the folder contains the .PHP file that asks that?
for example, I have a PHP file says
But the PHP file is in the "photos" folder, not upper then that.
Thank you
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Sat Nov 11, 2006 7:34 am
Sorry, I'm having difficulty understanding what you're trying to say. What do you mean by "upper" ?
eyal
Forum Newbie
Posts: 19 Joined: Mon Jun 19, 2006 11:03 am
Post
by eyal » Sat Nov 11, 2006 7:42 am
In a case like this:
folder1/folder2/file.php
folder1 is upper then folder2 - It comes before folder1.
So when I write on file.php, which is in folder2, i can't copy a file using the copy() function into folder1.
how can I solve that problem?
Thank you.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Nov 11, 2006 8:14 am
../sibling of folder 2/
Uploading of files needs to use
move_uploaded_file() , not
copy() , just so you know.
eyal
Forum Newbie
Posts: 19 Joined: Mon Jun 19, 2006 11:03 am
Post
by eyal » Sat Nov 11, 2006 8:34 am
Why move_uploaded_file is preferred then copy()?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Nov 11, 2006 9:06 am
Because
move_uploaded_file() works when safe_mode is on.