Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

[2542] Sending binary data with ASP

Last post 04-09-2003 12:27 AM by kiqkinas. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [2542] Sending binary data with ASP

    This thread is for discussions of Sending binary data with ASP.

    • Post Points: 0
  • 12-19-2002 2:32 PM In reply to

    • Pavanj
    • Not Ranked
    • Joined on 12-19-2002
    • New Member
    • Points 5

    opening a binaryfile in read/write mode

    I tried using oStream.mode=3 (in the article "sending binary data with Asp") but I am unable to open a word document in read/write mode. Does anyone have a solution for this?
    Thanks

    Pavan
    • Post Points: 0
  • 01-17-2003 7:34 AM In reply to

    • scottuk
    • Not Ranked
    • Joined on 01-17-2003
    • New Member
    • Points 50

    Sending Hidden PDF's to the Browser

    Using the following two articles i managed to get the result I needed ,

    http://www.developerfusion.com/show/2542

    http://www.developerfusion.com/show/2235

    See my other forum article for details ...

    http://www.developerfusion.com/forums/topic.aspx?id=11638

    • Post Points: 0
  • 04-09-2003 12:27 AM In reply to

    • kiqkinas
    • Not Ranked
    • Joined on 04-09-2003
    • New Member
    • Points 5

    Passing Binary Files to the User

    I've altered your code just a little and it works but it doesn't exactly solve my problem. See http://flyinghands.com/a_Download0.asp  

    This works as long as the file being downloaded is located on the same server as the script. I have so many files I've located them on a seperate hosting service from my web site.

    Here is my version:

    ------------------------------------------
    <%@ LANGUAGE="VBScript" %>

    <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
    <%
    Function getBinaryFile(strFilePath)
     Dim oStream
       
     Set oStream = Server.CreateObject("ADODB.Stream")
     oStream.Open
     oStream.Type = adTypeBinary
     oStream.LoadFromFile strFilePath
     getBinaryFile = oStream.read
     Set oStream = Nothing

    End Function

    Dim MyFile
    Dim MyPath
    Dim MyServer
    Dim Local

    MyPath = "d/lo/10/01/"
    MyFile = "d100101.mp3"

    Response.AddHeader "content-disposition","inline; attachment; filename=" & chr(34) & Myfile & chr(34)
    Response.ContentType = "application/x-unknown"
    Response.BinaryWrite getBinaryFile(Server.MapPath(MyPath & MyFile))

    %>
    ------------------------------------------

    The Line Server.MapPath(MyPath & MyFile) resolves to the local server and I need to pass a Remote URL. Any sugestions?

    • Post Points: 0
Page 1 of 1 (4 items)