sfWidgetFormInputSWFUploadPlugin
1.0.0stable
for sf 1.4sf 1.3sf 1.2sf 1.1 MIT
NEWS
2011/03/16
Removed outdated package files out of .svn repo
2010/05/14
Fixed a type error in package.xml. The plugin should now work within the plugin installer in sf1.4.x-projects.
2010/02/01
Checked for sf 1.4 compliency. It seems to work so far ...
2009/10/02
Fixed #2705 (http://trac.symfony-project.org/ticket/7205)
Thanks to enrico.b
Apple Safari compliency: Applied a patch to fix weird onLoad-behaviour in Apple Safari. Now onLoad listeners are bound and executed only if SwfObject had really been already loaded.
Thanks Andrew for reporting this bug.
Old news
Applied patch to fix interpretation of units of php.ini when calculation max upload file size. Thanks Jacek!
Improved browser compatibility, global queue progress will now render correctly.
Apple Safari 4 should work
IE 7 should work fine, IE 8 also.
IE 6 should work in some circumstances. Probably css and performance issues. 500 bucks reward dead or alive for this browser's inventor.
This plugin is yet in developement state, it will be documented when it's documented, and it's ready when it's done.
== Please help improving functionality by testing and giving me bug reports. ==
It is used withing sfFilebasePlugin, take a look there to see how it works. Or examine the source widgets, there are many options to let this plugin be highly configurable. A tiny example reveals the README file.
Developers
License
Copyright (c) 2007-2009 Johannes Heinen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Releases for sf 1.4
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
0.9.0stable
|
14/05/2010 |
|
0.9.10stable
|
MIT license |
0.9.0stable
|
03/01/2010 |
|
0.9.9stable
|
MIT license |
0.9.0stable
|
02/01/2010 |
Releases for sf 1.3
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
0.9.0stable
|
14/05/2010 |
|
0.9.10stable
|
MIT license |
0.9.0stable
|
03/01/2010 |
|
0.9.9stable
|
MIT license |
0.9.0stable
|
02/01/2010 |
Releases for sf 1.2
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
0.9.0stable
|
14/05/2010 |
|
0.9.10stable
|
MIT license |
0.9.0stable
|
03/01/2010 |
|
0.9.9stable
|
MIT license |
0.9.0stable
|
02/01/2010 |
|
0.9.8stable
|
MIT license |
0.9.0stable
|
02/10/2009 |
|
0.9.7stable
|
MIT license |
0.9.0stable
|
06/09/2009 |
|
0.9.6stable
|
MIT license |
0.9.0stable
|
10/08/2009 |
|
0.9.5stable
|
MIT license |
0.9.0stable
|
29/06/2009 |
|
0.9.4stable
|
MIT license |
0.9.0stable
|
27/06/2009 |
|
0.9.3stable
|
MIT license |
0.9.0stable
|
24/06/2009 |
|
0.9.2stable
|
MIT license |
0.9.0stable
|
13/06/2009 |
|
0.9.1stable
|
MIT license |
0.9.0stable
|
13/06/2009 |
Releases for sf 1.1
| Version |
License |
API |
Released |
|
1.0.0stable
|
MIT license |
0.9.0stable
|
14/05/2010 |
|
0.9.10stable
|
MIT license |
0.9.0stable
|
03/01/2010 |
|
0.9.9stable
|
MIT license |
0.9.0stable
|
02/01/2010 |
|
0.9.8stable
|
MIT license |
0.9.0stable
|
02/10/2009 |
|
0.9.7stable
|
MIT license |
0.9.0stable
|
06/09/2009 |
|
0.9.6stable
|
MIT license |
0.9.0stable
|
10/08/2009 |
|
0.9.5stable
|
MIT license |
0.9.0stable
|
29/06/2009 |
|
0.9.4stable
|
MIT license |
0.9.0stable
|
27/06/2009 |
|
0.9.3stable
|
MIT license |
0.9.0stable
|
24/06/2009 |
|
0.9.2stable
|
MIT license |
0.9.0stable
|
13/06/2009 |
|
0.9.1stable
|
MIT license |
0.9.0stable
|
13/06/2009 |
Changelog for release 1.0.0 - 14/05/2010
- Fixed package.xml problem
Other releases
Release 1.0.0 - 14/05/2010
- Fixed package.xml problem
Release 0.9.10 - 03/01/2010
- Upgraded javascript/Flash lib to V2.5b
Release 0.9.9 - 02/01/2010
- Checked for Symfony 1.4 compliency
- Frontend css-stylesheet
Release 0.9.8 - 02/10/2009
Release 0.9.7 - 06/09/2009
- Fixed bug in onLoad-Event in Safari that has bound other listeners to itself
even if swfobject was not already loaded.
Release 0.9.6 - 10/08/2009
- Fixed bug that delivered a wrong calculated max_upload_size from php.ini when using different units.
Release 0.9.5 - 29/06/2009
- Fixed bug with assets path on non web-root projects
- Fixed bug where URL helper must had been manually included
Release 0.9.4 - 27/06/2009
- IE 7 Compatibility
- Form serialisation: Submit button will now trigger startUpload()
Release 0.9.3 - 24/06/2009
Release 0.9.2 - 13/06/2009
- Added support for additional user defined javascripts
Release 0.9.1 - 13/06/2009
- CSS improvements, added optional JSON support
sfWidgetFormInputSWFUploadPlugin
sfWidgetFormInputSWFUploadPlugin decorates a file input widget with queued
uploading capabilities, provided by SWFUpload (www.swfupload.org).
This plugin is now an required dependancy of sfFilebasePlugin. See at its
sample project to see it in action.
Instructions:
Use the widget like an ordinary file upload widget and configure it by
passing custom options to its options array.
In custom form you'd to probably manually include the widgets assets (javascripts
and stylesheets). Do so by using $myform->getJavascripts() and
$myform->getStylesheets().
Please refer to the source file
(plugins/sfWidgetFormInputSWFUploadPlugin/lib/widget/sfWidgetFormInputSWFUPload.php)
and study the possible widget's options.
Note that the widget uses flash to perform the file upload. That means that the
form that wraps the widget will never be submitted by your webbrowser. You may
simulate a form submission by setting the option "send_serialized_values". This
forces the upload widget to serialize all form values and to send them as
additional parameters towards your upload service. This may not be the required
behaviour because the serialized data will be send within each server request,
which means each file beeing uploaded.
Example:
lib/form/TestForm.php:
class TestForm extends sfForm
{
public function configure()
{
$this->setWidgets(array(
'upload' => new sfWidgetFormInputSWFUpload()
));
$this->setValidators(array(
'upload' => new sfValidatorFile()
));
}
}
apps/frontend/modules/default/actions/actions.class.php:
class defaultActions extends sfActions
{
/**
* Executes index action
*
* @param sfRequest $request A request object
*/
public function executeIndex(sfWebRequest $request)
{
$this->form = new TestForm();
if($request->isMethod('put'))
{
// VALIDATE THE FORM, DO SOMETHING WITH THE FILES, ...
// ..
// ..
// UNSET THE RESPONSE
$this->setLayout(false);
return sfView::NONE;
}
}
}
apps/frontend/modules/default/templates/indexSuccess.php:
<form method="post" enctype="multipart/form-data" accept-charset="utf-8">
<p>
<?php use_stylesheets_for_form($form)?>
<?php use_javascripts_for_form($form)?>
<?php echo $form?>
<input type="hidden" name="sf_method" value="put" />
</p>
</form>
Feel free to override the css to fit your own
applications look and feel.
Installation
(Install instructions taken from README in sfThumbnailPlugin, (c) Fabien Potencier)
To install the plugin for a symfony project, the usual process is to use the
symfony command line.
With symfony 1.1/1.2/1.3/1.4, use:
$ symfony plugin:install sfWidgetFormInputSWFUploadPlugin
Alternatively, if you don't have PEAR installed, you can download the latest
package attached to this plugin's wiki page and extract it under your project's
plugins/ directory.
Clear the cache to enable the autoloading to find the new classes:
$ php symfony cc
Publish the plugins assets
$ php symfony plugin:publish-assets
You're done.
Credits
The guys managing and devolping the SWFUpload flash movie as well as its
javascript api should be mentioned here. Lern more at http://swfupload.org