I changed my Rails app from using send_file (from Rails) to using the headers as it says in the wiki http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed:wiki:feature:internal_redirect but now all my downloads open directly in the browser instead of forcing the "Save as..." dialog. Here is my previous Rails code:
And here are the headers I receive:
And here is my new code:
And here is the headers I receive:
My guess is that LS does not forward the extra headers like 'Content-Disposition' or 'Cache-Control'. Is there any way to force it do forward those headers or is there any other way to force the opening of the dialog instead of opening on the browser and still use the LS acceleration?
Thanks in advance,
Adrian Madrid
Code:
response.headers['Pragma'] = 'cache'
response.headers['Cache-Control'] = 'public, must-revalidate, max-age=0'
send_file res.full_path, :filename => res.filename, :type => res.content_type, :disposition => "attachment", :stream => true
Code:
HTTP/1.x 200 OK
Date: Tue, 29 Apr 2008 22:03:43 GMT
Server: LiteSpeed
X-Runtime: 0.06450
Content-Transfer-Encoding: binary
Pragma: cache
Content-Type: application/pdf
content-disposition: attachment; filename="M1304846_Messner_Ad_FINAL.pdf"
Cache-Control: public, must-revalidate, max-age=0
Set-Cookie: infocenter2_prod=24406976884d8229ff1904a660384981; domain=infocenter.iflo.com; path=/
Content-Length: 996315
Connection: close
Code:
response.headers['Pragma'] = 'cache'
response.headers['Cache-Control'] = 'public, must-revalidate, max-age=0'
response.headers['Status'] = '200 OK'
response.headers['Content-Disposition'] = "attachment; filename=" + res.filename
response.headers['Content-Type'] = res.content_type
response.headers['Location'] = res.web_path
response.headers['X-LiteSpeed-Location'] = res.web_path
render :nothing => true
Code:
HTTP/1.x 200 OK
Date: Tue, 29 Apr 2008 21:53:03 GMT
Server: LiteSpeed
Last-Modified: Fri, 20 Oct 2006 12:15:22 GMT
Content-Type: application/pdf
Content-Length: 996315
Connection: close
Thanks in advance,
Adrian Madrid
Last edited: