2017-09-21 18 views
0

對於我的POST端點之一的回報,我有Playframework:客戶端獲取504 HTTP錯誤從Ok.sendFile

Ok.sendFile(
     content = csvFile, 
     fileName = (_ => csvFile.fileName), 
     onClose = csvFile.cleanup 
    ) 

它發送一個CSV文件到客戶端。我遇到的問題是,當csv文件太大(對某些客戶端很少發生)時,它們會收到504網關超時錯誤。

The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature. 

當文件成功傳輸時不出現。

回答

0

正如討論gitter:增加E​​LB的超時值(默認值爲60秒)。

+0

這將緩解這個問題,但不是我們不幸的解決方案。很長一段時間來自於首先生成文件,因此我們將在後臺執行該工作並稍後提供一個鏈接,以供他們在準備好時下載它。 – irregular