In my asp page, there is a Download button. Clicking this button downloads data from oracle to an MS-Access (.mdb) file. This file is located on server at c:\Inetpub\ and filename is NewHRISDATA.mdb.
When the data insertion in MS-Access file is done, datatoxs.asp page is displayed showing the success message and a Download File Button. Clicking Download File Button was showing File Download dialog box with Open, Save and Cancel buttons and users were saving MS-Access file to their computers using this button.
Database server, Application Server and client computer were on workgroup earlier but now active directory services are installed and now all three are on the same domain. With this change (removing computers from workgroup and joining domain), Download File Button is no more working. When the user clicks Download File button, an error displays as follows:
This error occurs on startDownload.asp page, which has the following code:
We also have Excel .xls files in c:\Inetpub\ and startDownload.asp is working OK for Excel Files. But it is showing error for ms access files.
When the data insertion in MS-Access file is done, datatoxs.asp page is displayed showing the success message and a Download File Button. Clicking Download File Button was showing File Download dialog box with Open, Save and Cancel buttons and users were saving MS-Access file to their computers using this button.
Database server, Application Server and client computer were on workgroup earlier but now active directory services are installed and now all three are on the same domain. With this change (removing computers from workgroup and joining domain), Download File Button is no more working. When the user clicks Download File button, an error displays as follows:
There is a problem with the page you are trying to reach and it cannot be displayed. HTTP 500 – Internal Server Error.
This error occurs on startDownload.asp page, which has the following code:
Code:
Response.Buffer = True
Dim strFilePath, strFileSize, strFileName
Const adTypeBinary = 1
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fileObject = fso.GetFile(Request.Form("File"))
strFilePath = Request.Form("File")
strFileSize = fileObject.size
strFileName = fileObject.Name
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
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"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".asp"
ContentType = "text/asp"
Case ".mdb"
ContentType = "application/msaccess"
Case Else
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
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
We also have Excel .xls files in c:\Inetpub\ and startDownload.asp is working OK for Excel Files. But it is showing error for ms access files.