Solved

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

Posted on 2003-10-30
2
344 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
[X]
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
  • 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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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 informatio…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

636 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