Wait, you've used send_file? Do you delete the file after it's downloaded?<br><br><div class="gmail_quote">On 29 April 2010 09:07, Jon Gilbraith <span dir="ltr"><<a href="mailto:jon@professionalnerd.com">jon@professionalnerd.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yes, that's similar to how I've successfully served up files to a Flex app (granted with send_file rather than send_data, and I don't know any of the details of the Flex side of the implementation).<div>
<div></div><div class="h5"><br><br><div class="gmail_quote">
On 28 April 2010 17:23, Jordi Noguera Leon <span dir="ltr"><<a href="mailto:jordinoguera83@gmail.com" target="_blank">jordinoguera83@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>So, this <b>send_data @data, :type => 'application/x-amf', :filename => "@filename, :disposition => 'inline' </b>should work? </div><div><div></div><div><div><br></div><br><br>
<div class="gmail_quote">On 28 April 2010 16:23, Jon Gilbraith <span dir="ltr"><<a href="mailto:jon@professionalnerd.com" target="_blank">jon@professionalnerd.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jordi, you didn't mention the disposition there and if you don't specify 'inline' it'll default to attachment and prompt you to save rather than stream. <div>
<div></div><div><br><br><div class="gmail_quote">On 28 April 2010 15:56, Jordi Noguera Leon <span dir="ltr"><<a href="mailto:jordinoguera83@gmail.com" target="_blank">jordinoguera83@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hey!<div><br></div><div>@Neil, I don't quite see what you're trying to say... The thing is so far there aren't any files, I have the contents of the file that should be downloaded, but from here to downloading an actual file I have no clue how to do it...</div>
<div><br></div><div>@Ken, I've used send_data in other parts of the app where Flex wasn't used and calling it caused a dialog to appear in order to save a file (something like send_data(@my_data, :filename => :whatever)). So, what I was expecting was send_data to start a file download.</div>
<div><br></div><font color="#888888"><div>Jordi</div></font><div><div></div><div><div><br></div><div><br><br><div class="gmail_quote">On 28 April 2010 14:58, Kenneth Lee <span dir="ltr"><<a href="mailto:kenfodder@gmail.com" target="_blank">kenfodder@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#ffffff" text="#000000">
Hey,<br>
<br>
<tt>send_data</tt> sends binary data, not getting the expected results
doesn't tell me much, can you find out what you are getting back?
content-type etc... Also what are you expecting back, json, xml, a file?<br>
<br>
I recommend using curl or even a browser to talk to rails via http and
see if the data is what you expect your Flex app to receive as really
it's just acting as an API.<br>
<br>
Also for the invalid auth token just remove <tt>protect_from_forgery</tt>
from you application controller, or at least that is where you should
start as that is where the error is originating from I believe.<br>
<br>
Hope this gets you started.<br>
<br>
Ken<br>
<br>
Jordi Noguera Leon wrote:
<blockquote type="cite"><div><div></div><div>Hi there!
<div><br>
</div>
<div>I'm struggling to solve the following problem. We have an app
with a flex front end that displays some charts, each chart has a link
to download the data displayed in that chart. To do this I tried to
call a rails method that called send_data, but it didn't produce the
expected results. It'd be good if there was an easy way to do this
directly from Flex...</div>
<div><br>
</div>
<div>I've also been trying to follow the steps explained in this <a href="http://flexonrails.net/?p=5" target="_blank">article</a>,
but I'm getting an Invalid Auth token error...</div>
<div><br>
</div>
<div>Does anyone have an idea?</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Jordi</div>
<div><br>
</div>
<div><br>
</div>
</div></div><pre><hr size="4" width="90%"><div>
_______________________________________________
Chat mailing list
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</div></pre>
</blockquote>
</div>
<br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br>