# Send\_file con lighttpd

**URL:** <https://www.ruby-forum.com/t/send-file-con-lighttpd/71290>\
**Category:** IT\
**Created:** [October 6, 2006, 7:01pm UTC](https://www.ruby-forum.com/t/send-file-con-lighttpd/71290 "2006-10-06T19:01:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BSMaffettone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e68b1a/32.png) [@BSMaffettone](https://www.ruby-forum.com/u/BSMaffettone)\
**Post date:** [October 6, 2006, 7:01pm UTC](https://www.ruby-forum.com/t/send-file-con-lighttpd/71290/1 "2006-10-06T19:01:13Z")

</div>

Ben trovati.  
Ho questo metodo  
def scarica\_file\_e  
@erec\_items = ErecItem.find(:first)  
mese = @erec\_items.riferimento  
send\_file(“c:\file\_e\_#{mese}_utente_#{session[:user\_id]}.txt”,  
:filename =\> “file\_e\_#{mese}_utente_#{session[:user\_id]}.txt”)  
end

che con webrich funziona perfettamente salvando il file richiesto mentre  
con lighttpd me lo apre direttamente con in coda questo che segue

Content-Type: application/octet-stream  
Set-Cookie: \_session\_id=5430b9fb18e66c1b98e9eb1ec2e9c0e5; path=/  
Status: 200 OK  
Content-Transfer-Encoding: binary  
Cache-Control: private  
Content-Disposition: attachment; filename=“file\_e\_092006\_utente\_2.txt”  
Content-Length: 4032

anche se specifico :disposition =\> ‘attachment’ che poi Ã¨ il default.  
Il problema si verifica anche provando a salvare con clic destro.  
Quancuno Ã¨ al corrente del problema?  
In attesa …Grazie  
BM
