4 Replies Latest reply on Sep 15, 2007 1:37 AM by BKBK

    Creating an XML file with CFFILE on UNIX server

    CFMXPrGrmR Level 2
      I've run into a problem with creating an XML file on a UNIX server. I don't have access to the server and I'm trying to create an XML file so an outside agency can read it through the site URL.

      On a Windows machine I use GetDirectoryFromPath and ExpandPath to return the drive/path info, then I create the file with this and the query result. On the Unix web server I am only being returned a relative path, because of this I can't write the XML file to the web server. Any idea how to get around this?

        • 1. Re: Creating an XML file with CFFILE on UNIX server
          BKBK Adobe Community Professional & MVP
          GetDirectoryFromPath and ExpandPath should work on Linux, too. Did you attempt something like the following?


          • 2. Creating an XML file with CFFILE on UNIX server
            CFMXPrGrmR Level 2
            Knowing as little as I do about Unix I thought you still needed a drive "letter" to write the XML file to. I've been told I can get to the root but that it's root is "/bottomFolderName" (I was expecting R:\webRootPath\yourFolder\etc\XMLFileWrittenHere).

            I will post the error I saw next week, it's low on the priority right now. I do know the code works great on Windows but failed on the actual Unix web server. I'm using CF 7.02 if it matters.
            • 3. Re: Creating an XML file with CFFILE on UNIX server
              pheppler
              On Unix/Linux you don't have driveletters and absolute paths look like relative paths 'cause Unix/linux doesn't use \.
              C:\folder\subfolder is on Unix/Linux /folder/subfolder. And very important "Foldername" is not "folderName" and Linux doesn't support spaces in Foldernames like Windows does. Hope this helps a bit.
              • 4. Creating an XML file with CFFILE on UNIX server
                BKBK Adobe Community Professional & MVP
                Knowing as little as I do about Unix I thought you still needed a drive "letter" to write the XML file to. I've been told I can get to the root but that it's root is "/bottomFolderName" (I was expecting R:\webRootPath\yourFolder\etc\XMLFileWrittenHere).

                No, that is Windows thinking. You were told right. In Linux, a path usually begins with the forward slash /.

                I had doubts about your code itself. Did you run your version of my example on Windows? If it works, then you will only have to replace the Windows path with something like the following. The rest of the code remains the same.