染念Blog

为什么会有这篇文章,之前我所讲的方法是创建两个路径,但这是提交服务器之后的,
今天我又做了这样的情况:现在没有提交,但是选择文件后,又显示图片预览怎么办???
好在也是有方法,这让我查到了用HTML5 的File API

[button href="https://dyedd.cn/693.html"]之前对该方法的一解决措施[/button]

@(吐舌)

此处内容需要评论回复后方可阅读。

嗯,这里再讲下。
对于input[type='file']
当你上传后,你可以打印this.files[0]
或者files看看情况
可知this.files[0]就存了我们html5 api需要的对象

版权属于:染念
作品采用:本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
更新于: 2021年04月29日 09:07
2
发表评论
  1. c
        Windows 10 /    Google Chrome

    a

  2. 123
        Windows 10 /    Google Chrome

    123

  3.     MacOS /    Safari

    啊啊啊

  4.     Windows 10 /    Google Chrome

    大飒飒的·

  5. a
        Windows 10 /    Google Chrome

    评论

  6.     Windows 7 /    Google Chrome

    好的

  7.     Windows 10 /    Google Chrome

    应该不是直接访问本地文件吧

  8.     Windows 10 /    Google Chrome

    哈哈

    1. 123
          Windows 10 /    Google Chrome

      阿斯顿

  9.     Windows 10 /    Google Chrome

    撒大声地

  10.     Windows 10 /    Google Chrome

    撒大声地

    目录

    来自 《Not allowed to load local resource 又一解决方法》

    染念

    Big高性能计算、small前端...
    168 文章数
    625 评论量
    4 分类数
    172 页面数
    已在风雨中度过 6年107天16小时38分
    © 2023 染念Blog
    浙ICP备19020194号-1
    © 2023 染念Blog
    浙ICP备19020194号-1