Solved

Display Flash(swf) in ASP from database!!!

Posted on 2003-10-30
2
324 Views
Last Modified: 2008-02-01
HI,

I uploaded flash file(.swf) into database(mysql) in binary datatype(long blob).
Now I would like to view it using ASP
Am I suppose to use Response.BinaryWrite() or is there another way to do it
and how to do it.


thanks

pls advice
0
Comment
Question by:kennethcky
  • 2
2 Comments
 

Accepted Solution

by:
boduje earned 26 total points
ID: 9659342
See if this can work for you.  This assumes you have a specific page to show Flash files.

<%
  'Step 1: Read in the Flash ID from the querystring
  Dim FlashID
  FlashID = Request.QueryString("FlashID")
 
   'Step 2: Retrieve the flash file from the database
  Dim objConn, objRS, strSQL
  strSQL = "SELECT Flash FROM Table WHERE FlashID = " & SomeNumber
 
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open "DSN=YourDatabase"
 
  Set objRS = Server.CreateObject("ADODB.Recordset")
  objRS.Open strSQL, objConn
 
    'Step 3: Set the ContentType to image/jpeg
  Response.ContentType = "application/x-shockwave-flash"
   
  'Step 4: Use Response.BinaryWrite to output the image
  Response.BinaryWrite objRS("Flash")
   
  'Clean up...
  objRS.Close
  Set objRS = Nothing
 
  objConn.Close
  Set objConn = Nothing
%>

I've never stored anything in a database like that so I don't know how well it works.  Gook luck!
0
 

Expert Comment

by:boduje
ID: 9659362
OOPS:

Modification to Step 2:

  'Step 2: Retrieve the flash file from the database
  Dim objConn, objRS, strSQL
  strSQL = "SELECT Flash FROM Table WHERE FlashID = " & FlashID
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now