PDA

View Full Version : Change the AspBufferingLimit setting in Metabase.xml to a larger size


theflyingminstr
02-10-2008, 06:50 AM
I have an ASP script (WS Download) that prompts a user to "save as" when they (left) click a file/hyperlink. When I call for it to download more than 4 mb it won't save it.
After a bit of research I’ve found I need to change the AspBufferingLimit setting in Metabase.xml to a larger size.

I am a newbie and have no idea how to go about this. If someone could tell me how to do this like I have half a brain, that would be wonderful!

(Addition instructions I do not understand: make the Metabase.xml file write-able, you need to go to the IIS control panel, right click the server, select properties, and check off the box that says “allow changes to MetaBase configuration while IIS is running".)

Thanks so much!


This is the code I’m using:

<%@Language="VBScript"%>
<%Option Explicit%>
<%Response.Buffer = True%>


<%
On Error Resume Next
Dim strPath
strPath = CStr(Request.QueryString("FileName"))
'-- do some basic error checking for the QueryString
If strPath = "" Then
Response.Clear
Response.Write("Pas de fichier spécifié.")
Response.End
ElseIf Len(strPath) > 1024 Then
Response.Clear
Response.Write("Chemin trop long.")
Response.End
Else
Call DownloadFile(strPath)
End If

Private Sub DownloadFile(fichier)
'--declare variables
Dim strAbsFile
Dim strFileExtension
Dim objFSO
Dim objFile
Dim objStream
'-- set absolute file location
strAbsFile = Server.MapPath(fichier)
'-- create FSO object to check if file exists and get properties
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'-- check to see if the file exists
If objFSO.FileExists(strAbsFile) Then
Set objFile = objFSO.GetFile(strAbsFile)
'-- first clear the response, and then set the appropriate headers
Response.Clear
'-- the filename you give it will be the one that is shown
' to the users by default when they save
Response.AddHeader "Content-Disposition", "attachment; filename=" & objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"

Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
'-- set as binary
objStream.Type = 1
Response.CharSet = "UTF-8"
'-- load into the stream the file
objStream.LoadFromFile(strAbsFile)
'-- send the stream in the response
Response.BinaryWrite(objStream.Read)
objStream.Close
Set objStream = Nothing
Set objFile = Nothing
Else 'objFSO.FileExists(strAbsFile)
Response.Clear
Response.Write("Le fichier est inexistant.")
End If
Set objFSO = Nothing
End Sub
%>

angst
02-11-2008, 04:23 PM
try the script that I just posted on your other topic:

http://www.codingforums.com/showthread.php?t=132946


also, please don't double post, if you have more then one question about the same function/script, then please post both questions in the same thread.