在尝试通过预览获得多个文件选择输入,但发现IE不支持它之后,我改变了对多个文件上传的方式。
现在我有多个单文件输入,每个文件都有自己的“预览”div。每个选择和预览div的id被链接(输入select id ="file1",预览div id="previews_file1")等等。
我使用此代码预览选定的图像:
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload =
我有个预览按钮。当用户按下预览时,表单将提交到新选项卡上,以显示pdf文件中的数据。我用一个自定义的SubmitLink来做那个SubmitLink。
public abstract class SubmitResourceLink extends SubmitLink implements IResourceListener {
private final IResource resource;
@Override
public final void onResourceRequested() {
Attributes a = new Attributes(RequestCycle
客户端可以在上传之前预览,但上传后无法将其视为本地语言文件名。
所以我想在上传图片之前重命名文件名,因为它可以在上传之前和之后预览。
参考
How to provide alternative file names:
The name property of File objects is read only, but an alternative name can be provided as uploadName property for each individual file:
$('#fileupload').fileupload({
add: fun