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

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Sending private files

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2006, 07:12 AM
thijs thijs is offline
Member
 
Join Date: Sep 2006
Posts: 20
Default Sending private files

I'm wondering if Litespeed has feature similar to lighttpd's x-send-file option.

If you turn the option on and the Rails app sends a X-LIGHTTPD-send-file header with a path Lighttpd transfers the file to the client.

I'm using the send_file Rails method now, but this is quite expensive since it does all the IO in ruby, just setting the header and letting Litespeed handle the rest wouldn't stall the Ruby process.

Is there such a feature?
Reply With Quote
  #2  
Old 09-06-2006, 08:32 AM
dlhhyct dlhhyct is offline
Member
 
Join Date: Aug 2006
Posts: 41
Default it's an enterprise edition feature

http://www.litespeedtech.com/product...rver/editions/

from that page, i believe it's an enterprise edition feature, 30 days trial is available.
Reply With Quote
  #3  
Old 09-06-2006, 08:55 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
For that purpose, you can just set a location header with the corresponding URI to that file in the response header.
Like:
Code:
Location:/static/myfile
LSWS will perform a internal redirect and send the file back to client, do not set status header or the HTTP status line, otherwise, LSWS will perfrom a external redirect by sending back a redirect response to client.

The difference between "X-LIGHTTPD-send-file" header and "Location" header is that URI should be used in Location instead of the full path to the file.
Reply With Quote
  #4  
Old 09-06-2006, 09:12 AM
thijs thijs is offline
Member
 
Join Date: Sep 2006
Posts: 20
Quote:
Originally Posted by mistwang View Post
For that purpose, you can just set a location header with the corresponding URI to that file in the response header.
Like:
Code:
Location:/static/myfile
LSWS will perform a internal redirect and send the file back to client, do not set status header or the HTTP status line, otherwise, LSWS will perfrom a external redirect by sending back a redirect response to client.

The difference between "X-LIGHTTPD-send-file" header and "Location" header is that URI should be used in Location instead of the full path to the file.
That's not exactly what I'm looking for. The idea is that files are only sent to users that are authorized to download the file. The files shouldn't be in a public location so people can't paste the url in an email and let someone else download the file.

There may for example be a url /document/download/1. This checks if the current user has permissions to download and only sends the file if this is the case.
Reply With Quote
  #5  
Old 09-06-2006, 09:34 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
You can use a hard to guess URI, URI is not visible to user when LSWS perform an internal redirect, user only see the original URL to Rails, authentication can be done in Rails.

There is security concern if arbitrary file location is allowed.
Reply With Quote
  #6  
Old 09-06-2006, 10:17 AM
thijs thijs is offline
Member
 
Join Date: Sep 2006
Posts: 20
Hm indeed, I could just deny all access except from localhost as an extra security measure.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
lsz files jrmarino General 1 07-24-2007 11:00 AM
Forbid access to PHP files BobbyEasland Install/Configuration 3 05-08-2007 08:53 AM
Blocking files by extension Marcus Install/Configuration 2 02-28-2007 03:09 PM
Deletion of /tmp/lshhtpd swap & other lsws files athanasius Install/Configuration 1 02-23-2006 05:25 PM
gzip for static files with no write permissions IO Bug Reports 2 09-24-2005 08:26 AM


All times are GMT -7. The time now is 05:46 PM.



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