douzhengnao8265 2018-12-06 02:54
浏览 92

使用POST方法打开新窗口导致404错误(找不到文件)

I'm currently developing a web based app and encountering a weird problem. When I'm opening new window using POST parameter, it returns 404 error. But when I remove the POST parameter, the page loads fine. The problem happens only when I run the app in production server while when in localhost the problem does not occurs.

Here is an example of the code using POST:

let mapForm = document.createElement("form");
mapForm.target = "Report";
mapForm.method = "POST";
mapForm.action = 'http://1.1.1.1/example.php?sid=123';
let mapInput1 = document.createElement("input");
mapInput1.type = "text";
mapInput1.name = "TES";
mapInput1.value = 'TES VALUE';
mapForm.appendChild(mapInput1);
document.body.appendChild(mapForm);
var newwindow = window.open('',"Report","");
if(newwindow){
mapForm.submit();
}
document.body.removeChild(mapForm);

The above code will result in 404 error in production. Is there something missing in the code that I need to add or maybe permission problem on the server?

  • 写回答

1条回答 默认 最新

  • drctyr2869 2018-12-13 09:51
    关注

    SOLVED

    my form action is directing to "Report" subfolder in my aws server. It turns out that changing the directory name from "Report" to other solves the issue. Perhaps there is some kind of blocking in the server.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度