Solved

ASP Page 404 Error Help Needed

Posted on 2013-12-18
3
772 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the fast response that did the trick now working.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
"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,…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

771 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

11 Experts available now in Live!

Get 1:1 Help Now