Name
fileupload — A swf8-specific class for uploading a single file to a server
Description
A class for uploading a single file using the Flash 8 file upload api. This only works with
the swf8 runtime, that is, with lzr=swf8.
Using this class requires a service to which to upload. A sample upload jsp is provided,
which uses the cos.jar library from servlets.com. To use the example, copy cos.jar from
servlets.com into $TOMCAT_HOME/common/lib
and rename lps/components/incubator/uploader/example/upload.jsp.txt to upload.jsp.
On windows, edit upload.jsp to have the upload destination of your choice, ie "C:/",
by changing the value of saveDirectory. The destination
directory is currently /tmp/uploader, which will work for mac and linux servers.
Restart tomcat, so it will see the new jar, then visit
http://localhost:8080/legals/lps/components/incubator/uploader/example/test-fileupload.lzx?lzr=swf8
To upload multiple files, see multiplefileupload
(The terms of the servlets.com license forbid it from being redistributed
with Open Laszlo.)
Details
Properties (3)
-
maxsize
-
<attribute name="maxsize" value="10000" />
-
msg
-
<attribute name="msg" type="string" value="" />
message of feedback to user
-
uploadenable
-
<attribute name="uploadenable" type="boolean" value="false" />
public var uploadenable : boolean;
Enable upload. True to enable uploading, false to disable uploading.
Methods (10)
-
browse()
-
public function browse();
-
getName()
-
<method name="getName" />
public function getName();
-
onCancel()
-
<method name="onCancel" />
public function onCancel();
-
onComplete()
-
<method name="onComplete" />
public function onComplete();
-
onHTTPError()
-
<method name="onHTTPError" />
public function onHTTPError();
-
onIOError()
-
<method name="onIOError" />
public function onIOError();
-
onOpen()
-
public function onOpen();
-
onProgress()
-
<method name="onProgress" />
public function onProgress();
-
onSecurityError()
-
<method name="onSecurityError" />
public function onSecurityError();
-
upload()
-
<method name="upload" args="url" />
public function upload(url);
Call to actually upload the file to the server.
LZX Synopsis
<class name="
lz.fileupload" extends="
LzView
">
<attribute name="
maxsize
" value="
10000" />
<attribute name="
msg
" type="
string" value="
" />
<attribute name="
uploadenable
" type="
boolean" value="
false" />
<method name="
upload
" args="
url" />
</class>
JavaScript Synopsis
public
lz.fileupload extends
LzView
{
prototype public function
browse
();
prototype public function
getName
();
prototype public function
onOpen
();
prototype public function
upload
(
url);
}