小编Sha*_*anu的帖子

检索 pdf 时出现意外的服务器响应 (0)

我们在使用 Amazon ec2 实例时特别收到此错误。aws 实例上的配置为 Tomcat 7,Ubuntu 16.04,内存为 8GB。当用户尝试查看 pdf 文件时会发生这种情况。在我们的应用程序中,我们有一项功能,用户只能在浏览器上查看 PDF 文件,但不能下载它。PDF 文件在同一台服务器上。我们正在使用 cors 最小配置。我们已经在 Ubuntu 本地尝试过它,它运行良好。

在此处输入图片说明

代码片段:

var fileSplitContent = fileName.split(".");
    if ($('#viewImageOnlyForm')[0] != undefined && $('#viewPdfOnlyForm')[0] != undefined) {
        if (fileSplitContent[fileSplitContent.length - 1].toLowerCase() != "pdf") {
            $('#imageSource').val(requestURL + $.param(inputData));
            $('#viewImageOnlyForm').submit();
        } else {
            var requestURL = "rest/file/getCapitalRaiseFile?";
            $('#pdFSource').val(requestURL + $.param(inputData));
            $('#viewPdfOnlyForm').submit();
        }
    } else {
        // pop up download attachment dialog box
        downloadIFrame.attr("src", requestURL + $.param(inputData));
    }

}
Run Code Online (Sandbox Code Playgroud)

2017 年 1 月 4 日上午 5:07:31 org.glassfish.jersey.server.ServerRuntime$Responder writeResponse …

pdf pipe amazon-ec2 socketexception

5
推荐指数
1
解决办法
2824
查看次数

标签 统计

amazon-ec2 ×1

pdf ×1

pipe ×1

socketexception ×1