LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Rails send_file not working with litespeed

Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2008, 07:56 AM
bsharpe bsharpe is offline
New Member
 
Join Date: Mar 2008
Posts: 2
Default Rails send_file not working with litespeed

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.
Reply With Quote
  #2  
Old 03-08-2008, 08:23 AM
bsharpe bsharpe is offline
New Member
 
Join Date: Mar 2008
Posts: 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
Reply With Quote
  #3  
Old 03-08-2008, 06:32 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
better use our internal redirect function instead.

http://www.litespeedtech.com/support...ernal_redirect
Reply With Quote
  #4  
Old 05-26-2008, 06:54 AM
sderrick sderrick is offline
Member
 
Join Date: Apr 2005
Location: NM
Posts: 18
Quote:
Originally Posted by mistwang View Post
better use our internal redirect function instead.

http://www.litespeedtech.com/support...ernal_redirect
Can you show me an example of how to use the internal_redirect??

thanks, Scott
Reply With Quote
  #5  
Old 05-27-2008, 01:21 PM
sderrick sderrick is offline
Member
 
Join Date: Apr 2005
Location: NM
Posts: 18
Quote:
Originally Posted by sderrick View Post
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
Reply With Quote
  #6  
Old 05-27-2008, 01:30 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
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.
Reply With Quote
  #7  
Old 05-27-2008, 02:07 PM
sderrick sderrick is offline
Member
 
Join Date: Apr 2005
Location: NM
Posts: 18
Quote:
Originally Posted by mistwang View Post
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:13 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.