Solved

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jquery to restrict certain words from input in form 11 52
Button to go back 3 44
Obtain data from database .mdb 4 35
Classic ASP - Display returned sql output parameter 9 54
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…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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