?
Solved

ASP Responce object error ASP 0251 80004005 Responce Buffer exceed limit Help needed

Posted on 2014-01-27
7
Medium Priority
?
1,956 Views
Last Modified: 2014-01-27
ASP code
IIS 6

I created a web page is ASP
It lists files in a folder.
It now contains over 22650 mp3 files.
I have another 20,000 plus to go.

When I run the following code I get this error

Response object error ASP 0251 80004005
Response Buffer Limit Exceeded
/music,asp line 0
Execution of the ASP page caused the Response Buffer to exceed its configured limit.



The code was working up to a few days ago not sure what the magic number was to cause this error

Somewhere I read to add response.buffer = true

Where to place that in my code?

<% 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)) = "M4B" or UCase(fs.GetExtensionName(item.name)) = "M4P" or UCase(fs.GetExtensionName(item.name)) = "MP4" 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39813692
Add at the top of the page.

Response.Buffer = False


Else increase you buffer size, probably set low at the mo.
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 39813695
here's a good KB article describing some possible solutions:

http://support.microsoft.com/kb/925764

you can either put

Response.Buffer = False

at the top of the page and see if that resolves the issue or you can do a response.flush in your loop to dump out some of the buffer to the client machine:

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)) = "M4B" or UCase(fs.GetExtensionName(item.name)) = "M4P" or UCase(fs.GetExtensionName(item.name)) = "MP4" or UCase(fs.GetExtensionName(item.name)) = "WMA" Then
          url = MapURL(item.path)
          Response.Write("<li><a href=""" & url & """>" & item.Name & "</a></li>")
       end if
        Response.Flush
    next

Open in new window


***edit: was trying to bold where I put in the code, that didn't work out to well :)
0
 
LVL 23

Author Comment

by:Thomas Grassi
ID: 39813717
Thanks guys

I read somewhere a way to present a page using "record set paging"

I am new to ASP code how can I do that with the code I created already??
0
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 
LVL 58

Expert Comment

by:Gary
ID: 39813734
0
 
LVL 23

Author Comment

by:Thomas Grassi
ID: 39813815
Guys

Added Response.Buffer = False    still fails with error above


Response.Buffer = false
<% 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)) = "M4B" or UCase(fs.GetExtensionName(item.name)) = "M4P" or UCase(fs.GetExtensionName(item.name)) = "MP4" 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



Did I add it to the right place?

check it out  www.tomsmp3.com   click on Show All MP3 Songs
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39813828
Needs to be in code tags

<% Response.Buffer = false %>

Has to be the first line in the page as well.
0
 
LVL 23

Author Closing Comment

by:Thomas Grassi
ID: 39813839
Thanks that did it.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
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.
Suggested Courses

765 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