Large File uploading to asp.net MVC

半城伤御伤魂 提交于 2019-11-28 16:07:18
Solmead

I ended up using Darren Johnstone's ASP.NET File Upload Module to handle the uploading on the server side. Though I modified it slightly so that it could take a guid on the querystring that it would save the temp file to that guid name.

It was nice because it saved the file as it arrived at the server, and stripped the file out of the posted data which it then sends to the action on the controller that was specified.

Example in my view:

<input id="FileGUID" name="FileGUID" type="hidden" value="f632c00b-9b66-4716-8075-79df63b780fb" />
    <input type="file" id="FileUpload1" name="fileUpload1" />

    <script type="text/javascript">
        var UploadUrl = '/Video/AsyncUpload?FileGUID=f632c00b-9b66-4716-8075-79df63b780fb';
        $(function() {
            $("#FileUpload1").makeAsyncUploader({
                upload_url: UploadUrl,
                flash_url: '/Content/Flash/swfupload.swf',
                button_image_url: '/Content/Images/blank-button.png',
                button_text: '<font face="Helvetica, Arial" size="13pt" color="#ffffff">Upload File</font>',
                disableDuringUpload: 'input[type="submit"]',
                file_size_limit: '8024 MB',
                button_text_top_padding: 2
            });
        });
    </script>

Then in the actual save action for this page I look for a file where the asyncupload action would have saved the file based on the FileGUID

Can you do something similar to what is described in this link? I don't see why that wouldn't work in ASP.NET MVC.

May be this helps you : Multiple File Upload with Progress

A SignalR implementation example can be found here.

This also includes functionality for working with HttpContext.Request.GetBufferlessInputStream(), which allows you to begin working with the post data before it's fully uploaded.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!