• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating an XML file with CFFILE on UNIX server

Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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?

TOPICS
Advanced techniques

Views

495

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

GetDirectoryFromPath and ExpandPath should work on Linux, too. Did you attempt something like the following?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 15, 2007 Sep 15, 2007

Copy link to clipboard

Copied

LATEST
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.





Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation