Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Problems with JsCmds.RedirectTo + StreamingResponse on chrome
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Pollak  
View profile  
 More options Jan 31 2011, 9:52 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Mon, 31 Jan 2011 18:52:07 -0800
Local: Mon, Jan 31 2011 9:52 pm
Subject: Re: [Lift] Problems with JsCmds.RedirectTo + StreamingResponse on chrome

On Mon, Jan 31, 2011 at 6:22 AM, Bruna Colnago <brunacoln...@gmail.com>wrote:

> I'm trying to download a txt file with an ajaxBoutton using
> JsCmds.RedirectTo.

> bind("form","download" -> bDownload)

> def bDownload:NodeSeq = ajaxButton("Download",downloadForm _)

> private def downloadForm : JsCmd = {
>  JsCmds.RedirectTo("/result)
> }

> At my boot.scala I've add:

> class Boot {
>  def boot {
>    LiftRules.dispatch.prepend {
>      case Req("result" :: _, _ , _) => () => {
>        val str="Hello world\n"
>        val headers:List[(String, String)] =
>            List(("ContentType","application/vnd.text"),
>            ("Content-Length",str.length.toString),
>            ("Content-Disposition","attachment;filename=\"hello.txt
> \""))
>        val data = str.getBytes("UTF-8")
>        Full(StreamingResponse(new java.io.ByteArrayInputStream(data),
> () => {},data.length, headers, Nil, 200))
>      }
>    }

>  It works fine on Firefox, but the file won't download on chrome.
> Could anyone help'me finding where is the problem?

Please put together an example that demonstrates the issue Posting example
code | Lift Space |
Assembla<https://www.assembla.com/wiki/show/liftweb/Posting_example_code>

> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to liftweb@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscribe@googlegroups.com<liftweb%2Bunsubscribe@googlegroups.com >
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.

--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.