sheryi26 Posted October 11, 2010 Share Posted October 11, 2010 hi,I am working on the website, it has some mp3 files and we want users can download mp3 files when they click on the mp3 files link...it has done until last week! but now after cliking the links of mp3 files it is directly opened in windows media player program and buffered there.how can I have the first mood, opening the "save as" window for downloading the files after clicking the mp3 files links ?http://www.baharmovahed.com/bahar-music-ca...e/audio-en.html Link to comment Share on other sites More sharing options...
thescientist Posted October 11, 2010 Share Posted October 11, 2010 you can use PHP to achieve this kind of effect.http://www.google.com/#sclient=psy&hl=...29c82155c57878e Link to comment Share on other sites More sharing options...
Fmdpa Posted October 12, 2010 Share Posted October 12, 2010 <?phpheader('Content-Disposition: attachment; filename="file.mp3"');?> Link to comment Share on other sites More sharing options...
sheryi26 Posted October 28, 2010 Author Share Posted October 28, 2010 Finally I found the solution of the problem of my asp.net 2008 web application...it has ability of downloading mp3 files by helping of this page: http://www.west-wind.com/weblog/posts/76293.aspxit is working properly in my localhost, but after uploading it on the web, error page has been displayed!can anyone help me?<asp:Button runat="server" Text="Download" ID="Button1" onclick="Button1_Click" /> protected void Button1_Click(object sender, EventArgs e){Response.Clear();Response.ContentType = "audio/mpeg3";Response.AppendHeader("content-disposition", "attachment; filename=test1.mp3");Response.TransmitFile(Server.MapPath("test.mp3")); Response.End(); } Link to comment Share on other sites More sharing options...
thescientist Posted October 28, 2010 Share Posted October 28, 2010 well, what's the error message? Is your host ASP compatible? Link to comment Share on other sites More sharing options...
sheryi26 Posted October 28, 2010 Author Share Posted October 28, 2010 dear friend, thanks for your reply...I uploaded the project file in a folder of one of my websites...that website is working base on asp.net,but it is not working and have this undefined error even after changing customErrors mode to "Off"!Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration> Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.