Documentation is available at flexupload_example.php
- <?php
- /**
- * flexupload_example.php
- *
- * (C) 2007 SPLINELAB http://www.splinelab.com/flexupload/
- *
- * example how to use the FlexUpload class
- *
- *
- * Notes for migration from JavaUpload:
- *
- * This example is exactly the same like the one for the JavaUpload Applet.
- * As you can see migration from JavaUpload to FlexUpload is really simple.
- * Just change the class name to "FlexUpload" and you are done.
- *
- * FlexUpload uses a different approach to handle locale. Translations are
- * now stored in external xml files and not in property lists compiled into
- * the application. This is a great advantage because it's much more easier
- * to maintain the language files.
- * To specify the locale you now have to set the name of the language file
- * including the path to it!
- *
- * e.g.:
- * in JavaUpload you wrote
- * $jup = new JavaUpload();
- * $jup->setLocale("de_DE");
- *
- * in FlexUpload you write
- * $fup = new FlexUpload();
- * $fup->setLocale('locale/de.xml');
- *
- *
- * @version 1.0
- * @author Mirko Schaal <ms@splinelab.com>
- * @package FlexUpload
- * @subpackage example
- */
- /**
- * including the FlexUpload class
- */
- require_once("./class.flexupload.inc.php");
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>FlexUpload example</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- </head>
- <body link="#FF6600" vlink="#FF6600" alink="#FF6600" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
- <center>
- <h3><hr width="100%"><font face="Arial, Helvetica, sans-serif">Example for FlexUpload in english</font><hr width="100%"></h3>
- <p>
- <?php
- // should work in most cases to generate the url to the upload file
- // if it don't work, set a hard coded string e.g.
- // $url = 'http://localhost/upload_example.php';
- $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . '/upload_example.php';
- $fup = new FlexUpload($url.'?myGETVariable='.rawurlencode('you can even pass variables via GET e.g. a SESSION_ID to authenticate the user'));
- $fup->setMaxFileSize(5*1024*1024);
- $fup->printHTML(true, 'flexupload1');
- ?>
- </p>
- <h3><hr width="100%"><font face="Arial, Helvetica, sans-serif">Beispiel für FlexUpload in Deutsch</font><hr width="100%"></h3>
- <p>
- <?php
- $fup = new FlexUpload($url);
- $fup->setMaxFileSize(5*1024*1024);
- $fup->setLocale('locale/de.xml');
- $fup->printHTML(true, 'flexupload2', false);
- ?>
- <hr width="100%"><font size=-2 face="Arial, Helvetica, sans-serif"><a href="http://www.splinelab.com/flexupload/">(C) 2007 SPLINELAB</a></font>
- </center>
- </body>
- </html>
Documentation generated on Sun, 17 Jun 2007 11:38:02 +0200 by phpDocumentor 1.3.0RC3