I am using PHP magic constant to move uploaded file to a new location, and the upload handler file location is inside " _inc
" file inside the main application folder like this:
"path/tasksapp/_inc/upload_handelr.php"
So; when I use __DIR__
I get the path where the upload hander is exist:
"path/tasksapp/_inc/"
While the new location for uploaded file should be:
"path/tasksapp/uploads"
Is there's any option or attribute I can use with __DIR__
constant so I can change current directory to parent directory:
change:
"path/tasksapp/_inc/"
to be:
"path/tasksapp/"
I recommend dirname(__DIR__)
:
a/b/../c
is not allowed)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.