Solved

ASP Page 404 Error Help Needed

Posted on 2013-12-18
3
786 Views
Last Modified: 2013-12-18
Web site is on a Windows 2003 Web Server  using IIS 6 ASP and ASP.NET

the following code works great for MP3 files

It will list all file types MP3 M4A and WMA

When I click on any MP3 it will play in the browser no problem IE Firefox Chrome Safari.

When I click on M4A or WMA I get this error
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

If I convert the same .M4A file to MP3 it works

I have over 2400 hundred M4A files that I would rather not convert back to MP3.

Any thoughts on this?

<% ListFolderContents(Server.MapPath("/mp3/mp3musicalbums")) %>
<% sub ListFolderContents(path)
     dim fs, folder, file, item, url
     set fs = CreateObject("Scripting.FileSystemObject")
     set folder = fs.GetFolder(path)
    'Display the target folder and info.
     Response.Write("<h2>"& folder.Name &"</h2>")
     'Display a list of sub folders.
     for each item in folder.SubFolders
                ListFolderContents(item.Path)
     next
     'Display a list of files.
Response.Write("<ul>")
    for each item in folder.Files
       If UCase(fs.GetExtensionName(item.name)) = "MP3" or UCase(fs.GetExtensionName(item.name)) = "M4A" or UCase(fs.GetExtensionName(item.name)) = "WMA" Then
          url = MapURL(item.path)
          Response.Write("<li><a href=""" & url & """>" & item.Name & "</a></li>")
       end if
    next
        Response.Write("</ul>")
   end sub
   function MapURL(path)
     dim rootPath, url
     'Convert a physical file path to a URL for hypertext links.
     url = "/mp3/" & Right(path, Len(path) - 9)
     MapURL = Replace(url, "\", "/")
end function  %>

Open in new window

0
Comment
Question by:Thomas Grassi
3 Comments
 
LVL 32

Accepted Solution

by:
Big Monty earned 300 total points
ID: 39726958
try these steps:

1) Select the site to configure in IIS, right click and select "Properties"
2) Under HTTP Headers Tab, select "File Types" under the MIME Map section and select "New Type"
3) Type ".flv" as the associated extension and "video/x-flv" as the content type or "flv-application/octet-stream" I'm not sure on which one gives here.
4) for .mp4 files type ".mp4" as the extension and "video/mp4" as the mime type (this one I tested personally)
4) Select "OK",
5) type services.msc, find the "World Wide Web Publishing Service" and click on the restart icon on top or open up and choose restart
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 200 total points
ID: 39726971
You have to add the mime type to iis 6  http://support.microsoft.com/kb/326965

audio/mp4 .mp4 .m4a
0
 
LVL 23

Author Closing Comment

by:Thomas Grassi
ID: 39727055
Thanks for the fast response that did the trick now working.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now