|
(PHP) Uploading a file to the directory above your upload script?
|
|
01-05-2009, 11:49 AM
Post: #1
|
|||
|
|||
|
(PHP) Uploading a file to the directory above your upload script?
I am creating an upload manager for one of my projects and i want to upload the files to a directory in the one above the admin directory so i have been using:
PHP Code: $target = '../uploads'; But this dosn't seem to be working, is there another way? (either that or could someone suggest how i can make a relative url of a file work form both a WYSIWYG editor in /admin and the pages in the root directory? They obviously both have to be using the same code. My plugins & themes. The Fun Button! For Vista Sidebar & Windows 7 desktop gadgets. |
|||
|
01-05-2009, 12:20 PM
Post: #2
|
|||
|
|||
|
RE: (PHP) Uploading a file to the directory above your upload script?
When you make the call to move_uploaded_file, just use ".." in the path there.
|
|||
|
01-05-2009, 01:31 PM
Post: #3
|
|||
|
|||
|
RE: (PHP) Uploading a file to the directory above your upload script?
or use
PHP Code: $target = dirname(dirname(__FILE__))."/uploads"; |
|||
|
01-05-2009, 01:45 PM
Post: #4
|
|||
|
|||
|
RE: (PHP) Uploading a file to the directory above your upload script?
Have you defined a global Document Root? This helps a lot. In a root file of your program, do this:
PHP Code: define("DOC_ROOT", dirname(__FILE__)."/");-Doug MyBB Developer XHTML/CSS Designer, PHP & MySQL Developer | My Twitter Do not PM me for support or a custom theme. |
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help






