我有一個創建幾個CSV文件,拉鍊起來,並用這條線將它們發送到客戶端作爲附件(下載)Rails應用程序:發送壓縮文件作爲附件
send_file t.path, :x_sendfile => true, :type => 'application/zip', :filename => "invited_friends_stats.zip"
當我查看服務器上創建的壓縮文件,但我可以使用它,但是,當我通過應用程序下載文件時,它將解壓縮爲.zip.cpgz
文件,然後壓縮爲zip
文件,壓縮爲.zip.cpgz
文件,等等等等。
然後我下載了「The Unarchiver」應用程序(在Mac OSX上)和whe ñ我嘗試打開.zip
文件我收到一個錯誤:"the contents cannot be extracted with this program"
有沒有人知道爲什麼會發生這種情況?編碼錯誤等?有沒有我從上面的行中缺少的東西,或者在我的配置中會解決這個問題?