Assume we have the access to sth.avi
on www.dl.com
with a direct link.
www.dl.com\sth.avi
Also we have a website => www.dl2.com
.
Now, we wanna let some users to download sth.avi
from www.dl2.com
, but we don't have enough space on www.dl2.com
to save sth.avi
.
sth.avi
from www.dl.com
as streaming file and share it without saving the file on our domain.
P.S:
I don't wanna share this linkwww.dl.com\sth.avi
, actually I wanna share something like this link www.dl2.com\downloads\sth.avi
开发者_StackOverflow中文版Instead of streaming simply configure the web server on www.dl2.com
to redirect requests for /downloads/sth.avi
to www.dl.com/sth.avi
.
Yes.
Make an HttpWebRequest
to dl.com/...
and copy the HttpWebResponse to Response.Out
.
Make sure to disable buffering.
Well.... this is feasible, but it looks to me as a bad idea.
In order to achieve your result, you must open an HTTP request to www.dl.com
(the hoster of the video) and then, once you read bytes from there, redirect them to Response
stream.
I can't provide you with working code, but here is pseudo code
using (Stream fileStream = [open HTTP request to www.dl.com])
{
while (fileStream is not ended)
{
buffer = fileStream.Read();
Response.Write(buffer);
}
}
I repeat: that was pseudo-code!!!
精彩评论