If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP Mac file download header probs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-25-03, 18:20
cpgospi cpgospi is offline
Registered User
 
Join Date: Sep 2003
Location: MN US
Posts: 313
Angry ASP Mac file download header probs

Dear All,
I've built a simple upload/download utility in ASP/MSAccess. It works great except that I occasionally download files to a Mac (OS 9.2).
The Mac will not recognize the file type. I know very little about the Mac resource fork but I suspect I'm screwing it up. I've tried several browsers with basically the same results (Netscape, IE, Opera)
I've seen other posts with the same issue in the archives, but no acceptable solutions.
I'm including "datafile.asp" which writes the file to client browser

Thanks much in advance for any ideas,
Chris

<%
Dim oConn
Dim oRs
Dim sSQL
Dim nFileID

nFileID = Request.QueryString("FileID")

If Not nFileID = "" And IsNumeric(nFileID) Then

Set oConn = Server.CreateObject("ADODB.Connection")
Set oRs = Server.CreateObject("ADODB.Recordset")

oConn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("./") & "\Upload.mdb"

sSQL = "SELECT FileName, ContentType, BinaryData FROM Files WHERE FileID = " & Request.QueryString("FileID")

oRs.Open sSQL, oConn, 3, 3

If Not oRs.EOF Then
Response.ContentType = oRs("ContentType")
Response.AddHeader "Content-Disposition", "attachment;filename=""" & oRs("FileName") & """"
Response.BinaryWrite oRs(2)
Else
Response.Write("File could not be found")
End If

oRs.Close
oConn.Close

Set oRs = Nothing
Set oConn = Nothing
Else
Response.Write("File could not be found")
End If
%>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On