Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
UT-F and other ASP code. What is it for ? 3 31
two-way Authentication ASP 3 80
API works for 1 result, need to make it many 30 66
Want the count number from this QUery 2 38
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

20 Experts available now in Live!

Get 1:1 Help Now