How do I specify the relative path to a folder above the current script on a Linux server and on a NT server?

For example, I write a script to upload files to the server, and for security reasons I want the writable folder to be above the www folders in the file directory. How do I refer to folders above?

This is on a host's server so I can't use "home/folder/folder/" unless I know how their directories are structured. I need the relative path.

Thanks!

    ../ for Unix. I got that much. How about NT?

      WS_FTP to your domain.com. Your pathway will be listed on the top.

        No, that's not going to do the trick on NT unless it's the absolute path. Say I have Folder1 and a subfolder within it called SubFolder1. I have a script in SubFolder1 that uploads a file to Folder1. If I just enter whatever I see in ws_ftp ("/Folder1"), the script is going to try to upload to a subfolder of SubFolder1 called Folder1. See what I mean?

          I see what you mean...

          However, when I WS FTP to my account, on the pathway I see /home/mydomainname/. To enter my www folder I click on www. To store stuff outside of my www folder, I type /home/mydomainname/. So if I have Folder 1 and a subfolder called SubFolder 1 inside my www folder on WS FTP the pathname shows /home/mydomainname/www/Folder1 or if I'm in the subfolder /home/mydomainname/www/Folder1/SubFolder1. I have version WS_FTP95 (an older version). I don't know if that matters or not. Perhaps I can e-mail you this version of WS_FTP95 if you would like.

            Are you sure that's an NT server your site's being hosted on? Sure looks like a Unix server.

              hmmmm...

              it's a unix. I didn't realize they covered up the pathways on NT. That's probably your whole point, huh.

              i know to get to the base directory, you can type cd \

              does that help any?

                do you have a command line to work with?

                try typing cd or chdir and then enter. this should give you your current directory unless they are suppressing the directory no matter what. then maybe you should ask your system admin for the address.

                  Thank you but it's more out of curiosity. I have an NT development server so I can use the full path but there must be a way of using a relative path. Just haven't lucked upon it yet... Hopefully someone will come along and clue me in. It must be something obvious.

                  Thank you for your help!

                    ..\ for IBM systems, ../ for linux

                      Within a PHP script, I always use "../" if I need to refer to the relative parent of the current directory. It's worked prefectly in my scripts when used on *nix or Windoze

                        Write a Reply...