Viktor Kojouharov > IWL-SWFUpload-0.6.0 > IWL::SWFUpload

Download:
IWL-SWFUpload-0.6.0.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.6.0   Source  

NAME ^

IWL::SWFUpload - a file upload widget using the flash swfupload library

INHERITANCE ^

IWL::Error -> IWL::Object -> IWL::Widget -> IWL::Container -> IWL::SWFUpload

DESCRIPTION ^

The SWFUpload widget is a widget for upload files. It uses the flash swfupload library in order to achieve true multi-upload functionality. Visually, it's equivalent to a form's [Browse ...] button.

CONSTRUCTOR ^

IWL::SWFUpload->new ([%ARGS])

Where %ARGS is an optional hash parameter with with key-values.

multiple

If true, the invoked file selector can pick multiple files. Defaults to false

autoUpload

If true, file uploading starts as soon as the files are selected. An upload/stop button is never placed on the page.

PROPERTIES ^

The object has the following public properties

browse

A browse button, of class IWL::Button. When pressed, it invokes the browser file selector.

upload

An upload button, of class IWL::Button. Before the upload button starts, it's action is to start it.

stop

A stop upload button, of class IWL::Button. After the upload start, this button can abort the process.

SIGNALS ^

load

Fires when the widget is loaded.

file_dialog_start

Fires immediately before the file selector is displayed. Due to the blocking nature of the file selector, the callback might not be executed until the selector is closed.

file_queue

Fires when a file is queued. Receives the file object as a second parameter

file_queue_error

Fires when an error has occurred while queueing a file. It received the file object, error code and error message as parameters, starting from the second parameters

file_dialog_complete

Fires when the file selector is closed, and all the selected files have been processed. It received the number of selected files as a second parameter.

upload_start

Fires just before the file is uploaded. It receives the file object as a second parameter.

upload_progress

Fires periodically to indicate the upload process. It received the file object, the uploaded bytes, and the total byte count as parameters, starting from the second parameter. A bug in the Linux Flash Player might prevent this signal from firing more than once.

upload_error

Fires when an upload does not complete successfully, or by stopping/cancelling the upload. It receives the file object, error code and error message as parameters, starting from the second parameter.

upload_success

Fires when the upload has been completed successfully. Receives the file object and any data returned from the server as parameters, starting from the second parameter.

upload_complete

Fires at the end of the upload cycle. When fired, the upload will be fully completed, so that another may start. Receives the file object as a second parameter.

METHODS ^

setMultiple (BOOL)

Sets whether the widget's file selector can pick multiple files

Parameters: BOOL - if true, the selector can pick multiple files.

isMultiple

Returns true if the file selector can pick multiple files

setUploadURL (URL)

Sets the upload script to call

Parameters: URL - the url to call on file upload

getUploadURL

Returns the url of the upload script

setPostParams (%PARAMS)

Sets additional post parameters to pass to the script

Parameters: %PARAMS - a hash of parameters

getPostParams

Returns the post parameters

setFileTypes (TYPES, DESCRIPTION)

Sets the allowed file types for upload.

Parameters: TYPES - the allowed types. A semicolor separater string of glob patterns. See glob(3). DESCRIPTION - a description, which is displayed in the file selector

getFileTypes

Returns the allowed file types and the description.

setFileSizeLimit (LIMIT)

Sets the maximum size of the files to be uploaded.

Parameters: LIMIT - the size limit, in KB, unless a unit is specified. Examples: 147483648 B, 2097152, 2097152KB, 2048 MB, 2 GB

getFileSizeLimit

Returns the maximum size of the files to be uploaded

setFileUploadLimit (LIMIT)

Sets the maximum number of files that can be uploaded

Parameters: LIMIT - the number of files to be uploaded, or 0 for unlimited uploading.

getFileUploadLimit

Returns the maximum files that can be uploaded

setFileQueueLimit (LIMIT)

Sets the maximum number of files that can be queued

Parameters: LIMIT - the limit number. 0 for an unlimited queue

getFileQueueLimit

Returns the maximum number of files that can be queued

registerPlugin (PLUGIN)

Registers an SWFUpload plugin. The following plugins are currently available, and documented within their respective JavaScript files:

cookie

If this plugin is registered, it will automatically add the cookie string to a POST parameter, named SWFUploadCookie.

Parameters: PLUGIN - the name (or a list of names) of the plugin to register.

AUTHOR ^

  Viktor Kojouharov

Website ^

http://code.google.com/p/iwl

LICENCE AND COPYRIGHT ^

Copyright (c) 2006-2007 Viktor Kojouharov. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perldoc perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.