Member_2_6492660_1
asked on
ASP Responce object error ASP 0251 80004005 Responce Buffer exceed limit Help needed
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?
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 %>
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:
***edit: was trying to bold where I put in the code, that didn't work out to well :)
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
***edit: was trying to bold where I put in the code, that didn't work out to well :)
ASKER
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??
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??
Since this is off topic to the question
http://www.codeproject.com/Articles/619/ADO-Recordset-Paging-in-ASP
http://www.codeproject.com/Articles/619/ADO-Recordset-Paging-in-ASP
ASKER
Guys
Added Response.Buffer = False still fails with error above
Did I add it to the right place?
check it out www.tomsmp3.com click on Show All MP3 Songs
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 %>
Did I add it to the right place?
check it out www.tomsmp3.com click on Show All MP3 Songs
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks that did it.
Response.Buffer = False
Else increase you buffer size, probably set low at the mo.