Specifying applet parameters dynamically with JavaScript

Top  Previous  Next

In some cases you may wish to set applet parameters dynamically.   This can be accomplished on the server side using languages such as JSP, PHP or ASP.  Alternatively there are some parameters which you can define dynamically using client side JavaScript to invoke methods in the applet.

 

 

Method

Description

Example

document.httpapplet.setUrl(String url)

Sets the url that the upload should be submitted to.  Equivalent to setting the url applet parameter.

document.httpapplet.setUrl('http://www.domain.com/upload.php')

document.httpapplet.setRedirUrl(String url)

Sets the url the applet should be redirected to after a successful upload.  Equivalent to the redirUrl applet parameter.

document.httpapplet.setRedirUrl('http://www.domain.com/success.html')

document.httpapplet.setMaxFilesize(String filesize)

Sets the maximum allowed filesize of files to be uploaded.  Equivalent to the maxFilesize applet parameter.

document.httpapplet.setMaxFilesize('1MB')

document.httpapplet.setRequestParams(String params)

Sets additional request parameters to be submitted with the file upload.  Equivalent to the requestParams applet parameter.

document.httpapplet.setRequestParams('fname=john,lname=smith')

 

See also

 

Specifying the upload url

Specifying the return url

Specifying the maximum filesize

Specifying additional request parameters