【问题标题】:Accessing the file from a form with a input file element从带有输入文件元素的表单访问文件
【发布时间】:2011-07-02 07:50:53
【问题描述】:


我想使用 JavaScript 以这种形式访问文件(例如图像):

<form id="form" enctype="multipart/form-data">
<input type="file" size="40" value="" id="upload" name="upload"/>
<input type="submit" id="submit" name="submit"/>
</form>

有办法吗?我正在尝试将客户端指定的图像加载到 html5 cavas 元素中,而不将其发送回服务器。

【问题讨论】:

  • 不使用浏览器插件(Flash 或 Java 小程序),您可以使用 HTML5 JS 文件 API 执行此操作,但此功能仅在 FF 3.6+、Safari 6+、Chrome 7+ 中可用.

标签: javascript file html file-upload


【解决方案1】:

【讨论】:

猜你喜欢
  • 2012-08-14
  • 2015-12-10
  • 1970-01-01
  • 2019-09-29
  • 2012-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多