What to do to integrate FLASH UPLOAD WIDGET in Your HTML Page
Some easy steps are necessary:
- Copy the file uploadDialog.swf to the directory of your HTML page
- Create the directories 'php','js', and one directory as target for uploading files
- Copy the upload.php to -> php and swfObject.js to -> js. Set your upload targets directory to writeable (chmod0777)
- Insert code in your HTML page to display the uploadWidget.swf:
For the head-tag<script type="text/javascript" src="js/swfobject.js"> <script type="text/javascript"> var flashvars = {}; var params = { menu: "false", allowFullScreen: "true", quality: "high", scale: "noscale", salign :"TL" }; var attributes = { id: "uploadWidget", name: "uploadWidget", align: "middle" }; swfobject.embedSWF("uploadDialog.swf", "uploadWidget", "500", "150", "9.0.0", "expressInstall.swf", flashvars, params, attributes); </script>
In the body tag define the container<div id="uploadWidget"> </div>and around the code of your webpage
-
Edit the dialogSettings.xml file to point to your php file and the upload directory:
<uploadDialogSettings imageFileDescription = "Images (*.jpg, *.jpeg, *.gif, *.png)" imageFileExtensions = "*.jpg;*.jpeg;*.gif;*.png" textFileDescription = "Text Files (*.txt, *.rtf, *.doc)" textFileExtensions = "*.txt;*.rtf;*.doc" uploadUrl = "./php/upload.php?uploadpath=../assets/" />
Edit the dialog settings to adjust appearance of the widget.
The font MUST be the linkage ID of an embed font in your library of the uploadDialog.as. backgroundGradientColors and backgroundGradientRatios are arrays to set the background color and gradient. Set to equal values if you don't want to use a gradient background.<dialog glowColor = "0x5CE0F8" textColor = "0xFFFFFF" font = "Aurora" fontSize = "8" backgroundGradientColors = "0x333333,0x333335,0x333333" backgroundGradientRatios = "0,90,255" windowBorderColor = "0x000000" buttonBackgroundColor = "0x222222" buttonBorderColor = "0x000000" message = "Click Browse to select files for uploading" buttons = "okstart" />
See detailed explanations of parameters here. - Ready to use ;)







