从服务器下载mp4视频到指定的本地客户端 [英] Download mp4 video from server to specified client local

查看:188
本文介绍了从服务器下载mp4视频到指定的本地客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要将位于服务器下的视频下载到用户指定的本地路径。

我有一个Web服务器应用程序和客户端的嵌入式服务器应用程序。

不知何故,我需要从webmethod后面的代码获取字节缓冲区,然后我需要通过客户端的ajaxrequest将字节缓冲区发送到我的嵌入式服务器。

我怎么能这样做,还是有其他办法吗?

Hi,

I need to download videos which are located under server to user's specified local path.
I have a web server application and an embedded server application for client side.
Somehow I need to get byte buffer from code behind webmethod then I need to send the byte buffer to my embedded server via ajaxrequest from client side.
How can I do this way, or is there any other way to do it?

推荐答案

使用响应。



将ContentType设置为video / mp4并使用BinaryWrite发送内容。



Use Response.

Set the ContentType to "video/mp4" and use BinaryWrite to send the content.

Response.ContentType = "video/mp4";
Response.Clear();
Response.BufferOutput = true;
 
// use a reader to load the video content

Response.BinaryWrite(reader.Value);
 
Response.Flush();


我找到了这样做的方法,



嵌入式服务器和

http:// chimera .labs.oreilly.com / books / 1230000000545 / ch15.html #DOWNLOADING_DATA_WITH_XHR [ ^ ]
I found the way to do that,

Embedded server and
http://chimera.labs.oreilly.com/books/1230000000545/ch15.html#DOWNLOADING_DATA_WITH_XHR[^]


这篇关于从服务器下载mp4视频到指定的本地客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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