小编Mit*_*ell的帖子

使用ASP.net和jquery进行拖放

我尝试为头像图像创建拖放功能.我想要有人拖入盒子的文件; 上传到目录:'/ images/profile/$ username'.

这是我的代码:

<div class='fileDrop'>
    <span id='fileDropTarget'>Drag your files here</span>
</div>

<script>
    function fileSetUploadPercent(percent) {
        var uploadString = "Uploaded " + percent + " %";
        $('#fileDropTarget').text(uploadString);
    }

    function fileUploadStarted(index, file, files_count) {
        fileSetUploadPercent(0); //set the upload status to be 0
    }

    function fileUploadUpdate(index, file, currentProgress) {
        var string = "index = " + index + " Uploading file " + file.fileName + " size is " + file.fileSize + " Progress = " + currentProgress;
        $('#status').text(string);
        fileSetUploadPercent(currentProgress);
    } …
Run Code Online (Sandbox Code Playgroud)

c# asp.net jquery file-upload jquery-file-upload

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

asp.net ×1

c# ×1

file-upload ×1

jquery ×1

jquery-file-upload ×1