Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8507243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:48:54+00:00 2026-06-11T02:48:54+00:00

I have a website where a user can choose to view a video (no

  • 0

I have a website where a user can choose to view a video (no copyright) that is on a 3rd party website. From the moment the user choose it, it needs to be downloaded onto my web server before the user can access it. I tried to automatically start the download on the 3rd party website and make a response.redirect with this path, but when the user is watching the video, if the video has only 10 seconds downloaded, any player/browser will considere this video as a ten-seconds video and stop it after 10 seconds.

What would be the best practice to redirect a stream instead of a file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:48:56+00:00Added an answer on June 11, 2026 at 2:48 am

    I found that this piece of code is doing exactly what I want. It downloads a file on a third party website, and as it’s streaming it, each chunk is writen in the Response so that it completely obsfuscates the origin. Thus, it is possible to serve any file from any website as if I own it.

    Private Sub SendFile(ByVal url As String)
        Dim stream As System.IO.Stream = Nothing
        Dim bytesToRead As Integer = 10000
        Dim buffer() As Byte = New Byte((bytesToRead) - 1) {}
    
        Try
    
            Dim fileReq As System.Net.WebRequest = CType(System.Net.HttpWebRequest.Create(url), System.Net.HttpWebRequest)
            Dim fileResp As System.Net.HttpWebResponse = CType(fileReq.GetResponse, System.Net.HttpWebResponse)
            If (fileReq.ContentLength > 0) Then
                fileResp.ContentLength = fileReq.ContentLength
            End If
            stream = fileResp.GetResponseStream
            Dim resp As System.Web.HttpResponse = HttpContext.Current.Response
            resp.ContentType = "application/octet-stream"
            resp.AddHeader("Content-Disposition", ("attachment; filename=\""" + ("mp3" + "\""")))
            resp.AddHeader("Content-Length", fileResp.ContentLength.ToString)
            Dim length As Integer = 1000000
            While (length > 0)
                If resp.IsClientConnected Then
                    length = stream.Read(buffer, 0, bytesToRead)
                    resp.OutputStream.Write(buffer, 0, length)
                    resp.Flush()
                    buffer = New Byte((bytesToRead) - 1) {}
                Else
                    length = -1
                End If        
            End While
        Catch
            stream.Close()
        Finally
            If (Not (stream) Is Nothing) Then
                stream.Close()
            End If
        End Try
        Response.End()
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a website wherein a user can post information from our website to
I have a website which uses different style sheets from which users can choose
Okay, so I have a website where the user can put a search query
I have this website (C#/ASP.NET) with a form where the user can register for
I have a website and when the user logs in they can click on
So, I have a user driven website. Users can post whatever they want, even
I have a website that allows a user to upload a spreadsheet of items
I'm about to make a dynamic website in Django so that user can change
I'm making a website with specific posts that have tags created by the user.
I have a website where you can choose a timeslot via a dropdown box.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.