Internet Explorer缓存文件上传? [英] Internet Explorer Caching File Uploads?

查看:201
本文介绍了Internet Explorer缓存文件上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常基本的页面,它包含< input type =file> 元素。当我选择一个文件提交表单时,服务器响应一个在Excel中打开的电子表格(一个新窗口)。这种行为的含义是,初始屏幕和输入元素在IE中仍然可见。如果我更改所选文件的磁盘上的数据并重新提交表单,Internet Explorer将再次上传旧内容;发送到服务器的内容中不存在我的最新更改。如果我再次通过输入的浏览...按钮选择文件,新的文件内容将按预期上传。 Firefox总是从磁盘发送文件的内容,这是预期/期望的行为。看来,Internet Explorer正在做一些上传的文件内容的缓存。

有什么办法可以禁用这个功能,并有IE从磁盘上的数据每次提交表单?



有没有关于此行为的任何文档?这是我第一次遇到它,我的搜索很大程度上是空的。

解决方案

你可以用猜测

所以,这不是一个缓存的东西。这是一个跟踪错误。


I have a very basic page that includes an <input type="file"> element. When I submit the form with a file selected, the server responds with a spreadsheet that gets opened in Excel (a "new window"). The implication of this behavior is that the initial screen and input element are still visible in IE. If I change the data on disk of the selected file and resubmit the form, Internet Explorer uploads the old contents a second time; my latest changes are not present in the content sent to the server. If I select the file via the input's Browse... button again, the new file contents are uploaded as expected. Firefox always sends the file's contents from disk which is the expected/desired behavior. It seems that Internet Explorer is doing some kind of caching of the uploaded file contents.

Is there any way to disable this "feature" and have IE pull the data from disk each time the form is submitted?

Is there any documentation available on this behavior? It's the first time I've encountered it and my searches have largely come up empty.

解决方案

You can test out the conjecture with live demos posted on MS-Connect.

[...] the bug began with IE10, when FileList and Blob were implemented.
input.files is an html5 FileList of file/blob items.
To populate it, IE blobs each filepicker choice. They have a "snapshot state" (W3C term).
They're kept sync'd in case a selected file is updated before submission.
The bug is, IE fails to detect if the file is deleted, renamed, or replaced.
The filepicker snapshot goes stale in that circumstance.

Here is what happens when a file is selected in filepicker, then renamed and edited, prior to submitting the filepicker selection. Although a new file (with original filename) has been substituted in its place, the original file (now with different name and modified text) gets sent in the form. How is this possible? It is as though it was tracked via ntfs ObjectID, which is used with Distributed Link Tracking. Note carefully in this screenshot, the file name does not agree with the file content.

So, it's not a "caching" thing at all. It's a tracking bug.

这篇关于Internet Explorer缓存文件上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆