<div dir="ltr">Thanks everyone - the ZMI solution was what I was looking for, but I had already taken Sebastian&#39;s advice and now I&#39;m serving everything behind nginx, which was easier than I thought it would be.<div>
<br></div><div>Thanks!<br><div><br><div class="gmail_quote">On Tue, Sep 23, 2008 at 7:58 PM, Uli Fouquet <span dir="ltr">&lt;<a href="mailto:uli@gnufix.de">uli@gnufix.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi there,<br>
<div><div></div><div class="Wj3C7c"><br>
Pete Hunt wrote:<br>
<br>
&gt; I&#39;m developing a Flash/Flex application which communicates with Grok<br>
&gt; via AMF. The problem is, in order for the security to work, I need to<br>
&gt; add a crossdomain.xml file to the site root<br>
&gt; (<a href="http://host/crossdomain.xml" target="_blank">http://host/crossdomain.xml</a>). Unfortunately, I can only create views<br>
&gt; off of my application&#39;s path (<a href="http://host/myapp/blah" target="_blank">http://host/myapp/blah</a>), and I can&#39;t for<br>
&gt; the life of me figure out how to add a static file via the ZMI to the<br>
&gt; site root.<br>
<br>
</div></div>Michael told you already how to add a File-object to the root folder<br>
using the ZMI. There are, however, also some non-ZMI ways available.<br>
<br>
You could register a file in your `configure.zcml` like this::<br>
<br>
 &nbsp;&lt;configure<br>
 &nbsp; &nbsp;...<br>
 &nbsp; &nbsp;&lt;browser:resource<br>
 &nbsp; &nbsp; &nbsp;file=&quot;somedir/foo.xml&quot;<br>
 &nbsp; &nbsp; &nbsp;name=&quot;crossdomain.xml&quot; /&gt;<br>
 &nbsp;&lt;/configure&gt;<br>
<br>
which would make the file `foo.xml` located in the `somedir` directory<br>
of your package available under the name `crossdomain.xml`.<br>
<br>
The URLs<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;http://&lt;host&gt;/@@/crossdomain.xml<br>
<br>
or<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;http://&lt;host&gt;/++resource++crossdomain.xml<br>
<br>
would then deliver foo.xml with the correct filetype etc.<br>
<br>
Another, &#39;dirtier&#39;, approach would be to define a new view on root<br>
folders in your Grok application like this::<br>
<br>
 &nbsp;from zope.app.folder.interfaces import IRootFolder<br>
 &nbsp;import grok<br>
<br>
 &nbsp;class Crossdomain(grok.View):<br>
 &nbsp; &nbsp;grok.context(IRootFolder)<br>
 &nbsp; &nbsp;<a href="http://grok.name" target="_blank">grok.name</a>(&#39;crossdomain.xml&#39;)<br>
<br>
 &nbsp; &nbsp;def render(self):<br>
 &nbsp; &nbsp; &nbsp;self.response.setHeader(&#39;Content-Type&#39;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#39;text/xml; charset=UTF-8&#39;)<br>
 &nbsp; &nbsp; &nbsp;return &quot;&lt;doc&gt;Some XML&lt;/doc&gt;&quot;<br>
<br>
Here you could get the file contents like this::<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;http://&lt;host&gt;/crossdomain.xml<br>
<br>
which is the short form for<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;http://&lt;host&gt;/@@crossdomain.xml<br>
<br>
Given you have no object named &#39;crossdomain.xml&#39; in your root folder,<br>
the short form would return your view, i.e. your XML content. Hm, there<br>
are even more approaches, but that may help for now.<br>
<br>
Best regards,<br>
<br>
--<br>
<font color="#888888">Uli<br>
<br>
</font></blockquote></div><br></div></div></div>