Rails send_file not working with litespeed

#1
Hi,

I've setup litespeed on os X 10.5 and on Solaris 10 (Joyent) and i'm finding that my code that worked find for apache and nginx does not work for litespeed and I'd like to know if there's a workaround.

We do a lot of on-the-fly image creation and we typically create the image in a tempfile and then send that to the webserver that caches it for retrieval later.

<pseudocode>
tempfile.new do |tfile|
path = tfile.path
#create image in path

send_file path, :type => 'image/png', :disposition => 'inline'
end
# the tempfile is unlinked at the close of the block above

As I said, this works fine with nginx+mongrel or apache+mongrel, but not under litespeed+lsapi

Thanks for your help.
 
#2
Just a little more information:

- This does work on OS X. It does not work on Solaris 10 (Joyent server)

- On Joyent, i'm using the 4-cpu leased license 3.3.7
 
#5
Can you show me an example of how to use the internal_redirect??

thanks, Scott
I figured it out. Simpler than I though...

def sendfile
@name = session[:jobname] + ".zip"

filename = "public/download/" + @name
headers["Location"] = filename
redirect_to(filename)

end

Is this forum actually monitored by Litespeed? I hope I haven't chosen a product that isn't supported.

Scott
 

mistwang

LiteSpeed Staff
#6
Yes, it is monitored. :)
The reason for lacking response to your post is that we are not ruby/rails developer, we can only provide generic information about this feature, which we already did.
You are welcome to update the wiki to include your RoR code sample. :)
 
#7
Yes, it is monitored. :)
The reason for lacking response to your post is that we are not ruby/rails developer, we can only provide generic information about this feature, which we already did.
You are welcome to update the wiki to include your RoR code sample. :)
Thanks for the quick reply.. And thanks for the awesome webserver...

I'll update that Wiki right now...

Scott
 
Top