Dynamic Flash Images: Increased Functionality and Copy Protection for Online Images Jason W. Nadal.

Slides:



Advertisements
Similar presentations
PHP II Interacting with Database Data. The whole idea of a database-driven website is to enable the content of the site to reside in a database, and to.
Advertisements

The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
Adding Dynamic Content to your Web Site
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
Objectives Connect to MySQL from PHP
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Web Proxy Server. Proxy Server Introduction Returns status and error messages. Handles http CGI requests. –For more information about CGI please refer.
1 CS428 Web Engineering Lecture 23 MySQL Basics (PHP - VI)
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
SJSU CS157B Dr. Lee1  2004 Jenny Mitchell Two Useful Tools You Can’t Live Without by Jenny Mitchell SJSU CS157B Section PHP and MySQL.
INTRODUCTION TO WEB DATABASE PROGRAMMING
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
INTERNET APPLICATION DEVELOPMENT For More visit:
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Server-side Scripting Powering the webs favourite services.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
CSE 305 Theory of Database Tutorial on Connecting with Sybase from Java program and Developing GUI Jalal Mahmud, TA, CSE 305.
Internet Forms and Database Bob Kisel Amgraf, Inc.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
Introduction to MySQL Lab no. 10 Advance Database Management System.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Website Development with PHP and MySQL Saving Data.
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
HTML, PHP, and MySQL: Putting It All Together. Making a Form Input tags Types: “text” “radio” “checkboxes” “submit”
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
14. Uploading Files to MySQL Database. M. Udin Harun Al Rasyid, S.Kom, Ph.D Desain dan.
Creating PHPs to Insert, Update, and Delete Data CS 320.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Leman Akoglu 11/11/ Fall 2009 Recitation Homework 9 Building A Web Application Phase-II School of Computer Science.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Using Flash with php Very quick introduction to Flash Homework: work on projects.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 27 HTTP and WWW.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Chapter 8 Manipulating MySQL Databases with PHP PHP Programming with MySQL 2 nd Edition.
Database Connectivity and Server-Side Scripting Chapter 12.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Chapter - 11 Introduction to File and Streams This chapter includes -  Defining a File  Testing and Checking File Objects  Accessing File Objects.
CSC 405: Web Application Engineering II8.1 Web programming using PHP What have we learnt? What have we learnt? Underlying technologies of database supported.
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
PHP WORKSHOP (Session 1) INFO 257 Supplement. Outline What is PHP ? PHP Language Basics PHP Exercise.
Unix System Administration
PHP / MySQL Introduction
Distributed Computing, M. L. Liu
Distributed Computing, M. L. Liu
Lecture 5: Functions and Parameters
Introduction to JavaScript
Presentation transcript:

Dynamic Flash Images: Increased Functionality and Copy Protection for Online Images Jason W. Nadal

The Process

Database Initial Database stores long blob info, actually the binary contents of the image. CREATE TABLE testjpgs ( id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY, description CHAR(255), bin_data LONGBLOB, filename CHAR(255), filesize CHAR(50), filetype CHAR(50) ); Database could be either in MySQL, Access, or any other data source accessible through either PHP or ASP.

STORE.PHP (Client View) Adds the Image from a disk or the server’s hard drive to the database. Adds the Image from a disk or the server’s hard drive to the database. Data is then accessible through read.php Data is then accessible through read.php

STORE.PHP (Back End) <HTML> Store binary data into SQL Database Store binary data into SQL Database</TITLE></HEAD><BODY><?php // code that will be executed if the form has been submitted: if ($submit) {// connect to the database MYSQL_CONNECT("localhost","root",""); mysql_select_db("imageDB"); mysql_select_db("imageDB"); $form_data_size = filesize($form_data); $form_data_size = filesize($form_data); $form_data_name = $form_data; $data = addslashes(fread(fopen($form_data, "r"), filesize($form_data))); $result=MYSQL_QUERY("INSERT INTO testJPGs(description,bin_data, $result=MYSQL_QUERY("INSERT INTO testJPGs(description,bin_data, filename,filesize,filetype) ". "VALUES ('$form_description', "VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')"); $id= mysql_insert_id(); $id= mysql_insert_id(); print " This file has the following Database ID: $id "; ?> "> "> <? MYSQL_CLOSE(); } else { // else show the form to submit new data: // else show the form to submit new data:?> File Description: File Description: File to upload/store in database: File to upload/store in database: <?php}?></BODY></HTML>

READ.PHP (Front End) READ.PHP is available only on the local network in order to only allow access to the full JPEG version of the image for trusted machines. READ.PHP is available only on the local network in order to only allow access to the full JPEG version of the image for trusted machines. READ.PHP is passed one variable: the row number of the image in the database ($id, ex. /read.php?id=4 ) READ.PHP is passed one variable: the row number of the image in the database ($id, ex. /read.php?id=4 )

READ.PHP (Back End) <?php if($id) { // you may have to modify login information for your database server: // you may have to modify login information for your $query = "select bin_data,filetype from testJPGs"; $query = "select bin_data,filetype from testJPGs"; $result $result $data $data $type $type Header( "Content-type: $type"); Header( "Content-type: $type"); echo $data; echo $data;};?>

ServerWriteJPEG.dll No existing ATL control will let the page take an image from a URL and convert it to a single frame SWF movie. No existing ATL control will let the page take an image from a URL and convert it to a single frame SWF movie. ServerWriteJPEG.dll is a COM+ ATL control written in Java (J++) to do just that ServerWriteJPEG.dll is a COM+ ATL control written in Java (J++) to do just that

ServerWriteJPEG.dll (1) import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; import java.applet.Applet; public class WriteJPEG { public String copyFileFromURL(String theURL, String outFile) { //takes the file at fileURL and copies it to a file //on the server's hard drive, destFile URL url; try{ url = new URL(theURL); File outputFile = new File(outFile); URLConnection conn = url.openConnection(); InputStream in = conn.getInputStream(); FileOutputStream out = new FileOutputStream(outputFile); int c; while ((c = in.read()) != -1) out.write(c); in.close(); in.close();out.close();} catch (Exception exc) {} return "Finished."; }

ServerWriteJPEG.dll (2) public String copyFile(String inFile, String outFile) { //copies a file from the server to another location on the server. File inputFile = new File(inFile); File outputFile = new File(outFile); try{ FileInputStream in = new FileInputStream(inputFile); FileOutputStream out = new FileOutputStream(outputFile); int c; while ((c = in.read()) != -1) out.write(c); while ((c = in.read()) != -1) out.write(c); in.close(); in.close();out.close();} catch (Exception exc) {} return "Finished."; }}

Temp Image File - Transition A temporary image file now exists on the server. This paves the way for the file to be converted into a single frame flash image. A temporary image file now exists on the server. This paves the way for the file to be converted into a single frame flash image.

J2S.dll - The Conversion This DLL file is an ATL control written in C++, as part of a package to convert images to flash movies. This DLL file is an ATL control written in C++, as part of a package to convert images to flash movies. The component J2S.Converter.1 has the method Convert which takes 2 file arguments, input and output, and generates that SWF file on the backend when the client requests a page. The component J2S.Converter.1 has the method Convert which takes 2 file arguments, input and output, and generates that SWF file on the backend when the client requests a page.

Swift-Generator Swift-Generator (swiftgen.exe) is a CGI program written in C/C++ that allows the programmer to add dynamic content to a flash movie. Swift-Generator (swiftgen.exe) is a CGI program written in C/C++ that allows the programmer to add dynamic content to a flash movie. Swift-Generator takes 1 argument, the location of the SWS scripting file. (ie: “ /cgi/swiftgen.exe?sws=/assets/sws /movie.sws ”) Swift-Generator takes 1 argument, the location of the SWS scripting file. (ie: “ /cgi/swiftgen.exe?sws=/assets/sws /movie.sws ”) SwiftGen then compiles the published SWT template file along with any assets mentioned in the SWS scripting file and creates the final compiled movie. SwiftGen then compiles the published SWT template file along with any assets mentioned in the SWS scripting file and creates the final compiled movie.

mainMovie.sws % Jason Nadal %(c)2002 %mainMovie.swsSwift-Generator Scripting file %Script template from Template file mainMovie.swt %compiles the Template File (mainMovie.swt) with the assets into the final %result SWF movie when called with Swift-Generator CGI program. INPUT "../php/ccsc/flashMovie/mainMovie.swt" % Output for testing %OUTPUT "export.swf" % Output for CGI OUTPUT -cgi "-" % Font definitions % FONT 4 is Times New Roman (224 glyphs) SUBSTITUTE TEXT 5 { FONT 4 HEIGHT 24 KERNING 0.98 COLOR #ffff80 STRING "Image Gallery - Protected Image" }

mainMovie.fla ActionScript The main movie file contains a separate movie instance from _root which loads the generated single frame looping image movie using the command: The main movie file contains a separate movie instance from _root which loads the generated single frame looping image movie using the command:loadMovie("image.swf",_root.spotformovie); This will change dynamically without rechanging the flash source every time the client requests an image. This will change dynamically without rechanging the flash source every time the client requests an image.

Generated Movie Code <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B " codebase=" wflash.cab#version=5,0,0,0" WIDTH=450 HEIGHT=350> WIDTH=450 HEIGHT=350> <PARAM NAME=movie <PARAM NAME=movie VALUE=" bin/swiftgen.exe?sws=../php/ccsc/flashMovie/mainMovie.sws"> VALUE=" bin/swiftgen.exe?sws=../php/ccsc/flashMovie/mainMovie.sws"> <EMBED src=" bin/swiftgen.exe?sws=../php/ccsc/flashMovie/mainMovie.sws" quality=high bgcolor=# WIDTH=450 HEIGHT=350 TYPE="application/x-shockwave-flash" PLUGINSPAGE=" P1_Prod_Version=ShockwaveFlash"> TYPE="application/x-shockwave-flash" PLUGINSPAGE=" P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></BODY>

showResult.asp – The Container ShowResult.asp contains the calls to all of the COM+ components to do all of the dirty work of creating the copy of the LAN image, the single frame flash movie, and the final result window. ShowResult.asp contains the calls to all of the COM+ components to do all of the dirty work of creating the copy of the LAN image, the single frame flash movie, and the final result window.

showResult.asp - Code <% Set myObject2 = Server.CreateObject("ServerWriteJPEG.WriteJPEG") theURL=" theID = Request("id") theURL=theUrl+theID result = myObject2.copyFileFromURL(theURL,"d:\xitami\webpages\php\ccsc\imageTemp\image.jpg") Set myObject = Server.CreateObject("J2S.Converter.1") myObject.FlashVersion = 5 %><br><% result = myObject.Convert("d:\xitami\webpages\php\ccsc\imagetemp\image.jpg", "d:\xitami\webpages\php\ccsc\flashMovie\image.swf") "d:\xitami\webpages\php\ccsc\flashMovie\image.swf")%><br> </iFrame>

Before - Conventional Pictures may be saved onto the local hard drive, and may be modified as usual JPEG files.

The Final Movie The movie now protects the image from direct copying, thus adding a layer of protection to the original image, making it much more difficult to just copy the file.