Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2003-10-30
2
333 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

860 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