<div dir="ltr"><font color="#330033"><font size="2"><font face="tahoma,sans-serif">Amir,<br>The path to the file should be:<br>(a) accessible to the image you're running, and of course allowed by its file permissions.<br>
(b) generally an absolute path, however your nginx configuration might need a tweak to set this up. Maybe you're missing something that nginx requires? take a look: <a href="http://wiki.nginx.org/XSendfile">http://wiki.nginx.org/XSendfile</a><br>
<br>Additionally, I don't understand why you're passing a MultiByteFileStream if all you need is the path to the file.<br><br><br>Avi.<br></font></font></font><br><div style="margin: 0pt;" name="sig_d41d8cd98f"></div>
<div class="gmail_quote">On Wed, Mar 9, 2011 at 9:41 PM, AA <span dir="ltr"><<a href="mailto:aa@serendip.demon.co.uk">aa@serendip.demon.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I experimented exhaustively with this just recently; it simply doesn't work when I have files stored on my OS's native filesystem. And I MUST apologise, because I didn't get around to filing a bug report. (Sorry!)<br>
<br>
First of all, there's no method forURIReturnSingleMimeTypeOrDefault:, which is called by MIMEDocument class >> guessTypeFromName: url, which is in turn called when trying to determine the file MIME type.<br>
<br>
I did my downloads like this (note: 'aFile' is a MultiByteFileStream:):<br>
<br>
html anchor<br>
callback: [ self downloadFile: aFile ];<br>
with: aFile localName.<br>
<br>
downloadFile: aFile<br>
self requestContext respond: [ :response |<br>
response<br>
contentType: (MIMEType forFileNameReturnSingleMimeTypeOrDefault: aFile localName);<br>
attachmentWithFileName: aFile fullName;<br>
headerAt: 'X-Accel-Redirect'<br>
put: aFile name ]<br>
<br>
I'm using nginx as my webserver, so the 'X-Accel-Redirect' is the equivalent for the standard 'X-SendFile' header.<br>
<br>
Now, this worked nicely in the past, but since I've upgraded to the latest Seaside 3.0.4, I'm having some problems... So right now I'm debugging to find out what's going on (could be a misconfigured webserver, of course).<br>
<br>
Amir<br>
<br>
<br>
<br>
On Wed, 9 Mar 2011 11:25:59 -0500<br>
John McKeon <<a href="mailto:p3anoman@gmail.com">p3anoman@gmail.com</a>> wrote:<br>
<br>
> Ricardo,<br>
><br>
> You can use WAAnchorTag>>#document:mimeType:fileName: to render a download<br>
> link.<br>
> Have a look at the code for WAUploadFunctionalTest>>#renderDownloadLinksOn:<br>
> to see how it is used.<br>
> (If you look at the test in the browser, you will have to upload a file<br>
> first before you will see the download links rendered)<br>
><br>
> Hope this helps<br>
> John<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br></div>