Warning: Creating default object from empty value in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 334
C l e a r G l a s s ~ Blog
CG Rotating Images

Welcome to C l e a r G l a s s


Strict Standards: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 29

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 31

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 32

Strict Standards: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 29

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 31

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 32

Problem with ADODB.Stream and large files


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/42/d301471907/htdocs/wp-includes/functions-formatting.php on line 76

I was working on a system that will force a prompt to save when downloading files using a web browser. I ran into a problem with downloading larger files. An easy fix is to increase the AspBufferingLimit in Metabase.xml.

ASP Code:

Response.Buffer = True
Dim Path, file, strFilePath, strFileSize, strFileName, objStream, strFileType, ContentType
Path = Request("Path")
File = Request("File")
 
Const adTypeBinary = 1
 
strFilePath = Server.MapPath(Path) & “” & file
strFileName = file
strFileType = lcase(Right(strFileName, 4))
 
Select Case strFileType
 Case “.asf”
  ContentType = “video/x-ms-asf”
 Case “.avi”
  ContentType = “video/avi”
 Case “.doc”
   ContentType = “application/msword”
 Case “.zip”
  ContentType = “application/zip”
 Case “.xls”
  ContentType = “application/vnd.ms-excel”
 Case “.gif”
  ContentType = “image/gif”
 Case “.jpg", “jpeg”
  ContentType = “image/jpeg”
 Case “.wav”
  ContentType = “audio/wav”
 Case “.mp3″
  ContentType = “audio/mpeg3″
 Case “.mpg", “mpeg", “mpga”
  ContentType = “video/mpeg”
 Case “.rtf”
  ContentType = “application/rtf”
 Case “.htm", “html”
  ContentType = “text/html”
 Case “.asp”
  ContentType = “text/asp”
 Case Else
  ’Handle All Other Files
  ContentType = “application/octet-stream”
End Select
 
Response.AddHeader “Content-Disposition", “attachment; filename=” & strFileName
Response.AddHeader “Content-Length", strFileSize
Response.Charset = “UTF-8″
Response.ContentType = ContentType
 
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
 
Response.BinaryWrite objStream.Read
 
objStream.Close
Set objStream = Nothing
 
Response.Flush

Error Message:

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

Solution:

If you get the above error when you click on an attachment, the attachment is larger than IIS is configured to allow. Change the AspBufferingLimit setting in Metabase.xml to a larger size. The default value is 4194304, which is about 4 MB. Change this to whatever limit is reasonable for the types of files your users will be attaching.

This change does not require stopping IIS, but to 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".

References:

Xefteri - Downloading any file using ASP…
FogBugz - IIS 6: Cannot open attachment…
WindowsDevCenter.com - Inside the XML Metabase of IIS 6

— admin @
Strict Standards: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 29

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 31

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 32
10:49 am
Strict Standards: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 29

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 31

Strict Standards: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 32
7/25/2005

ClearGlass LLC © 2009-2011. All rights reserved.