I am trying to @FILE binding for the following URL,
http://hudsonarmstrong.com/creekside/typeidlist.txt . The link is to a resource rendered as .txt but when using the following "Input Option Values" with a single select input MODX tv it shows the following error message "Could not retrieve document '/creekside/typeidlist.txt' ".
@FILE /creekside/typeidlist.txt
What could be the issue?
Did you try it without the leading slash?
Hi bob, I have tried various URLs just in case it was a path issue but have had no success. I was wondering if there is an issue in using a file which is created by a resource so tried accessing a static
http://www.hudsonarmstrong.com/creekside/assets/test.txt file but still no success.
That suggests that it might be a permission or ownership issue related to the file or its directory.
I assume that you've tried putting the file in the assets directory and using:
I have managed to get access to the file using
. Unfortunately I am unable to get the binding to work with a dynamic MODX generated resource nor a RSS driven feed located at
http://hudsonarmstrong.com/creekside/core/components/bookingsystem/index.php?controller=pjListings&action=pjActionSearch&txt=1.
Does binding have issues when trying to access dynamically generated files?
My "Friendly URL" is enabled and I have /creekside/ set within the .htaccess file as root.
@FILE assumes a real disk file (it's using a path, not a URL), so if the physical file exists, it will work, but AFAIK, if not it won't.
Would it work to use a static chunk? That would give you an actual file to process.
The data is generated from an RSS feed, I was hoping to simply strip the xml and use the raw txt for binding. Is there anyway to bind an RSS feed? An alternative will be to write data to a static file :s
-
☆ A M B ☆
- 24,524 Posts
The @FILE binding uses PHP's file_exists() and fopen() functions. You could do some testing with a .php file to see if you can access your feed using those functions.
Yes, if allow_url_fopen is on for your server, you may be able to use the full URL to get it. I was also surprised to see that @FILE doesn't add a prefix, so you should be able to access files outside of the web root with it.