problem description
I use iframe to connect to an embedded page, but keep requesting errors? The requested page is avatarForm
<body>
<div class="container">
<form id="myAvatar" class="form-horizontal col-lg-12 col-xs-12" method="POST" action="/avatar" enctype="multipart/form-data">
<div class="form-group">
<label class="col-lg-4 col-xs-12 control-label" style="padding: 0" for="fileinput">
<input type="file" id="fileinput" name="realfile" />
<p class="upload">+
</label>
<div class="col-lg-4 col-xs-6 col-xs-offset-3" style="text-align:center;">
<input type="text" class="form-control ava-dir" name="avatar" readonly>
</div>
</div>
<div class="form-group" style="line-height:32px">
<label class="col-lg-4 col-xs-3 control-label" style="padding: 0">
<span class="size"></span>
</label>
<div class="col-lg-4 col-xs-6" style=" margin: 0 0 10px 0;">
<input type="text" class="form-control filesize" name="filesize" readonly>
</div>
<kbd>Byte</kbd>
</div>
<button class="btn btn-success" type="submit" style="margin:auto;display:block;"></button>
</form>
</div>
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
<div class="model">
<div class="avatarBox container">
<div class="col-lg-12 col-xm-12" style="position: relative;">
<h3></h3>
<span class="close glyphicon glyphicon-remove"></span>
<hr/>
</div>
<iframe src="/avatar" frameborder="0" width="100%" height="450"></iframe>
</div>
</div>
the route is handled as follows:
//avatarForm
router.get("/settings/avatarForm",function(req, res){
if(req.session.user){
res.render("settings/avatarForm.html", {
user: req.session.user
})
}else{
res.render("login.html")
}
})
the result is