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 1049457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:37:12+00:00 2026-05-16T16:37:12+00:00

Have some audio and video files that users are to download, however depending on

  • 0

Have some audio and video files that users are to download, however depending on the file type or browser the browser may attempt to play the file instead of downloading it. This is not desired, how can I avoid this? The anchor will be a direct link to the file unless I need to create some sort of Action to handle this properly. I am using C# ASP.NET MVC.

  • 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-05-16T16:37:13+00:00Added an answer on May 16, 2026 at 4:37 pm

    The important parts are setting the response headers. Set both the content-type header and the content-disposition header. Here is an example:

     Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName)
     Response.AddHeader("Content-Length", lenOfFile)
     Response.ContentType = "application/octet-stream" 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some audio and video files stored in a server. I need to
I have some very large (650MB) content files (video, audio) in about 4 different
I would like to use HTML 5 for video/audio viewing, but I have some
I have some javascript that I am using for some audio on my website:
I have .asf files. All of them have 2 video streams and 1 audio
I have developed an iPhone application which will have some files (images, audio &
I've got some .MP4 video files that must be read in a VideoView in
I'm working on a site that users uploads videos and audio files, I when
I have some movies encoded by an app that separates the audio and the
I have some arbitrary pixel data that I want to save as a PNG.

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.