来自服务器路径的下载视频文件&保存到客户端电脑 [英] Downoad video file from server path & save to client pc

查看:95
本文介绍了来自服务器路径的下载视频文件&保存到客户端电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上有视频。我想给客户提供视频下载选项。



提前致谢。



额外从下面的评论中复制的信息

我的研究足够好。但我没有得到我想要的东西,我不知道这种方式是写还是错,所以我只是提出问题。



我试过回复。 TransmitFile但关闭了我的整个页面

I have video on my server. I want to give video download options to client.

Thanks in advance.

additional information copied from comments below
I have research good enough. But i am not getting what i want and i don't know whether that way is write or wrong so i have just put questions.

I have tried "Response.TransmitFile" but that closed my whole page

推荐答案

这不是CP通常的工作方式。这里最重要的目标是学习和帮助学习。

你应该自己尝试,当你遇到困难时来到这里,对你的代码,设计等有一个具体的问题。

请查看你有什么尝试? [ ^ ]和如何提问? [ ^ ]

看看我的意思是一个很好的解释。这些链接将帮助您提高问题的质量,因此有可能获得您正在寻找的答案



不要忘记这里的人不会得到所许。此外,如果我们给你一个现成的解决方案,它不会帮助你,因为你不会从中学到任何东西。



On另一方面......一种可能的方法是:

步骤1)做一点研究。谷歌是一个很好的起点

步骤2)开始编码

步骤3)编译并使用调试来解决小问题

步骤4)当你遇到问题时你不知道如何解决但至少你试过了,然后回来问一些具体的代码片段给出了问题



很抱歉,如果这不是你想要的答案。但你的问题有点太宽,无法在快速答案中得到解答。如果你对具体问题提出10个具体问题,那就更好了,你得到更快的帮助,而不是一个关于操作指南的大问题





PS写作解决方案,以避免这个问题在未答复的列表中。如果它得到改进,请删除评论,我将编辑或删除此消息
This is not how CP usually works. Most important goal here is to learn and help learning.
You are supposed to try it on your own, and come here when you got stuck with something, with a concrete question about your code, design, etc.
Please have a look to What have you tried?[^] and How to ask a question?[^]
to see a good explanation about what I mean. Those links will help you to improve the quality of your question and hence the probability to get the answer you are looking for

Don't forget people here don't get payed. And besides, if we give you a ready-to-go solution, it is not going to help you because you are not going to learn anything from it.

On the other hand... a possible approach would be:
Step 1) Do a little research. Google is a good start point
Step 2) Start coding
Step 3) Compile and use the debug to solve little issues
Step 4) When you get a problem you don't know how to solve but at least you tried it, then come back and ask for something concrete with a snippet of the code giving problems

Sorry if this is not the answer you were looking for. But your question is a bit too wide to be answered at the "Quick" Answers. It is better and you get faster help if you make 10 concrete questions about concrete problems, than a big question about a "how-to guide"


P.S. Written as solution to avoid this "question" to be in the unanswered list. If it gets improved, please drop a comment and I will edit or delete this message


Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment;
filename=" + VideoName);
Response.AddHeader("Content-Length", VideoURL);
Response.ContentType = "text/plain";
Response.Flush();
Response.TransmitFile(vVideoName);
Response.End();


这篇关于来自服务器路径的下载视频文件&保存到客户端电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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