Internal Redirect problem

Discussion in 'Ruby/Rails' started by sderrick, May 29, 2008.

  1. sderrick

    sderrick New Member

    I'm using Internal Redirect to send large files. Here's my function:

    def sendfile
    @name = session[:jobname] + ".zip"
    filename = ":public/download/" + @name
    headers["Location"] = filename
    redirect_to(filename)
    end

    It works fine on Firefox but Safari and IE7 hang for a while and then say there is no document as that address?

    Anybody else seen this issue? Is my code correct?

    thanks,

    Scott
  2. mistwang

    mistwang LiteSpeed Staff

    Install wireshark and sniff the traffic see if you can find out anything.
  3. sderrick

    sderrick New Member

    It appears that Safari and IE choke on having spaces in the redirect address. Not to surprising. Firefox has no problem.

    Rails must have a built in path tool to convert it to a safe href?

    Scott
  4. mistwang

    mistwang LiteSpeed Staff

    If the browser receive the redirect response, a external redirect is used, not internal redirect. Maybe you should try

    def sendfile
    @name = session[:jobname] + ".zip"
    filename = ":public/download/" + @name
    headers["x-litespeed-Location"] = filename
    end
  5. sderrick

    sderrick New Member

    Thanks,

    I'll give it a go.

    Scott

Share This Page