我是MVVM模式的铁杆粉丝,特别是在使用ASP.NET MVC框架(在本例中是v2预览版2)时。
但我很好奇,有没有人知道如何在上传文件时使用它?
public class MyViewModel
{
public WhatTypeShouldThisBe MyFileUpload { get; set; }
}
客户端可以在上传之前预览,但上传后无法将其视为本地语言文件名。
所以我想在上传图片之前重命名文件名,因为它可以在上传之前和之后预览。
参考
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
我已经想了一个多月了。当图像在预览者上点击'x‘时,我无法从数组中删除该图像。
我用剪接的尝试失败了!
$('#list').on('click', '.remove_img_preview',function () {
$(this).parent('span').remove();
//this is not working...
var i = array.indexOf($(this));
if(i != -1) {
arr
当我上传一个图像时,它会在div中对图像进行预览。我已经做到了。但我想上传多张照片。
当我试图上传一个图像时,它会在多个地方进行预览。
我希望image1在image1容器中被上传和预览,当图像2被上传并在图像2容器中预览时。
这是小提琴。我试着用.closest,但没有用
$(document).ready(function() {
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = fu