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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:38:25+00:00 2026-06-13T03:38:25+00:00

I have ASP.NET WebForms project with online player. When i click play player asks

  • 0

I have ASP.NET WebForms project with online player. When i click “play” player asks web handler for mp3 using such code:

public void ProcessRequest(HttpContext context)
    {
        context.Response.Clear();
        context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        context.Response.Cache.SetNoStore();
        context.Response.Cache.SetExpires(DateTime.MinValue);

        context.Response.ContentType = "audio/mpeg";

        string songID = context.Request.QueryString["song"];
        if (string.IsNullOrEmpty(songID))
            return;
        Song song = new Song();
        song.GetSong(long.Parse(songID));
        // Show filename in format "artist - song.mp3"
        context.Response.AddHeader("Content-Disposition", "attachment; filename=" + (string.IsNullOrEmpty(song.ArtistName) ? song.Title : (song.ArtistName + " - " + song.Title))); // title for file download
        context.Response.WriteFile(song.FileName);

        context.Response.End();
}

And after that player(i use JPlayer) starts playing the song. This thing works in all browsers, even on android and windows phones, tho it doesnt play some songs on safari(ON OSX! On windows Safari everything works fine) and iPhone. As i discovered there is something wrong for them with the handler, because when i try to set direct path to mp3 file that was not playing through handler-iphone plays it well. Just don’t know what can be wrong here.. Why do they play some files and don’t play other(mp3s were encoded using same software and they have same bitrate)?

  • 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-13T03:38:27+00:00Added an answer on June 13, 2026 at 3:38 am

    In case anyone faces such problem..
    The answer is: safari/iphone respect REST too much. They need context.Response.AddHeader("Accept-Ranges", "bytes");
    to play mp3 properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My project is in Asp.Net Webforms using C#. On one of my web pages,
I'm starting a new web project using ASP.NET Webforms + EF4. I'm trying to
I have a legacy (haha) ASP.Net Webforms Web Site Project in Visual Studio 2008
I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a
I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or
I have a asp.net webforms page in which I'm using the jqGrid component. The
When using ASP.net webforms my usual solution would have following type of setup -
I have a simple web app built in asp.net webforms c# where and how
I have an ASP.NET 3.5 webforms project written in VB that involves a multi-table
I have a pretty big web application that I created last year using ASP.NET

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.