Solved

ASP Page 404 Error Help Needed

Posted on 2013-12-18
3
794 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 33

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp Google Map 2 64
warning code: class php incomplete message 6 37
MediaWiki - Move a site 4 33
Saving Web Page as PDF 9 47
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

726 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