后台文件上传? [英] background file uploader?

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

问题描述

所以经过不断使用Google显然问错了问题的两天,我想我已经找到了一种方法来字呢,所以我得到我在寻找的响应。

So after two days of googling incessantly and apparently asking the wrong questions, I think I have figured out a way to word it so I get the response I'm looking for.

我有一个项目管理应用程序,写在MVC3。有时,用户必须附加大型文件并将其上传到应用程序。 (100-200 MB)是典型的。当然,问题是,这是目前处理的同步和不同的网络速度意味着应用程序可以被完全阻断10分钟到一个小时,如果有人是一个缓慢的连接。 FTP是不是一种选择,在这里(我的手被我们的网络家伙在那一个并列)。

I have a Project Management application, written in MVC3. Sometimes, the users have to attach large files and upload them to the applications. (100-200 mb) is typical. The problem of course is that this is currently handled synchronously, and varying network speeds mean that the application can be completely blocked for 10 minutes to an hour if someone's on a slow connection. FTP is NOT an option here (my hands are tied by our network guys on that one).

所以我在寻找一种方法做以下工作流程:

So I am looking for a way to do the following workflow:


  • 用户单击上传文件

  • 用户选择文件上传

  • 用户点击转到或任何按钮

  • 申请说
  • 你的文件正在上传。你会当它是完整的通知
  • 用户继续使用该应用程序为正常。

  • user clicks Upload File
  • user selects File to upload
  • user clicks "Go" or whatever button
  • Application says "your file is being uploaded. You will be notified when it's complete"
  • user continues to use the application as normal.

有些事情需要注意的:我已经有实现的内部邮件系统。所以,当我说,应用程序将通知用户它的完成时 - 它需要做的一切都插入一个新的消息到队列。它并不需要通知用户当前的屏幕或类似的东西 - 所以我不担心任何类型的返回值。我也有一个背景错误日志实现的,因此,如果出现错误,并再次我可以插入一个消息到日志 - 通过内部短信系统通知用户。

Some things to be aware of: I already have an internal messaging system implemented. So when I say that the app will notify the user when it's complete - all it needs to do is insert a new message into the queue. It DOES NOT need to notify the user's current screen or anything like that - so I'm not worried about a return value of any kind. I also have a background Error log implemented, so I can insert a message into the log if something goes wrong and again - inform the user via the internal messaging system.

所以我难倒如何实现这一点。我想到了一个异步控制器是正确的道路要走,但如果我理解所有我已经看到了的东西 - 它不是。欢迎大家指正。我实现了使用异步一个版本,但解决一个问题,它有时,我被告知,我是做错了呢。

So I am stumped on how to implement this. I thought an Async Controller was the right way to go, but if I understand all the stuff I've been seeing - it's not. Feel free to correct me. I implemented a version using Async but when addressing the one problem it had, I was informed that I was doing it wrong anyway.

所以呃...帮助吗?我所有的耳朵。

So uh...help? I'm all ears.

推荐答案

如果您可以使用第三方控件再看看在Telerik控制:

If you can use 3rd party controls then take a look at the Telerik controls:

http://www.telerik.com/products/aspnet-mvc/ upload.aspx

它有一个异步文件上传的控制。

It has an Asynchronous File Upload control.

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

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