@{
    ViewBag.Title = "Picture";
}
<!DOCTYPE html>
<html>
<head>
    <script src='@Url.Content("~/assets/plugins/jquery-1.10.2.min.js")' type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#fileInput").on("change", function () {
                var file = this.files[0];
                if (this.files && file) {
                    var reader = new FileReader();
                    reader.onload = function (e) {
                        $("#img").attr('src', e.target.result);
                        $("#fn").text(file.name);
                        $("#fs").text(file.size);
                    }
                    reader.readAsDataURL(file);
                }
            });
        });
    </script>

</head>
<body>
    <h2>Picture</h2>
    <div>
        <input  />
        <br />
        <img  />
        <br />
        <span ></span>
        <span ></span>
    </div>
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-03-05
  • 2021-08-18
  • 2022-03-08
  • 2021-06-30
猜你喜欢
  • 2021-10-21
  • 2021-07-15
  • 2021-06-22
  • 2021-12-06
相关资源
相似解决方案