2017-09-21 20 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