Placing file to root

whenever i uplaod a file to matrix, it will be autmatically place the file to a path like "http://domain.com/__data/assets/file/00001/0000023/file.txt"


is there a way to save it to the url?



i am uploading a robots.txt and is needed to be uplaoded in the root folder (www.domain.com/robots.txt).



any help would do…

[quote]whenever i uplaod a file to matrix, it will be autmatically place the file to a path like "http://domain.com/__data/assets/file/00001/0000023/file.txt"


is there a way to save it to the url?



i am uploading a robots.txt and is needed to be uplaoded in the root folder (www.domain.com/robots.txt).



any help would do…[/quote]



Yup, on the details screen of your file asset, set "Allow Unrestricted" to no. This will make Matrix serve the file rather than Apache, and it will give you a URL that is reflective of how it is placed in the asset map.



Thank you very much sir... :P

[quote]
Yup, on the details screen of your file asset, set "Allow Unrestricted" to no. This will make Matrix serve the file rather than Apache, and it will give you a URL that is reflective of how it is placed in the asset map.

[/quote]



If you follow the process in reverse - ie, set "Allow unrestricted" to "Yes" from its current "No" - are you able to use any process to predict what the subsequent URL will be? It seems to use the asset ID as the penultimate folder, but the numerical directory that precedes it (in bold below) seems pretty random.



domain.com/__data/assets/file/00001/0000023/file.txt



We are considering doing this for a large site whose server is running full speed all the time, and wondering if we are able to control what happens to the URLs of the pdfs on our site, many of which we would expect people to have bookmarked.

That directory is a 4-digit hash of the asset ID and can be worked out in a PHP script by calling the same hashing function we use, but I wouldn't try to figure it without using the code.