I'm trying develop a File Manage System for user upload/download file.
This system include two part(machine):
- Web Server(asp.net mvc) : File CRUD
- File Server (WCF) : using Windows File System or Nosql store file.
When use download a file, the process is...https://i.stack.imgur.com/gmL5K.png
The file has been send twice!
I hope File Server directly send file back to browser, but have no idea how to do it.
My wcf service contract is like:
interface FileService {
Stream Download(string filename);
void Upload(string filename, Stream file);
}
ASP.net mvc code:
class FileController : Controller {
HttpResponseMessage Get(string filename) {
// call wcf service here, and return.
}
}
Please suggest, Thanks!
Update:
Not action
call twice...
I mean the file send twice: from file server to web server to browser
Maybe it my program's architeture problem, wcf service shouldn't return a stream?