This documentation is for the old version. Go to the latest Upload Suite docs

ImageUploader.Action Property

Supported in: ActiveX , Java

URL of the page to which files selected for upload in Image Uploader are sent to.

Syntax

Initialize

JavaScript
<script type="text/javascript" src="iuembed.js">  </script>
<script type="text/javascript">
var iu = new ImageUploaderWriter("ImageUploaderID", 610, 500);
//...other params...
iu.addParam("Action", ".");
//...other params...
iu.writeHtml();
</script>

Get/Set Value in Runtime

JavaScript
getImageUploader("ImageUploaderID").setAction(value);
value = getImageUploader("ImageUploaderID").getAction();

Property Value

A string that specifies the URL to the page files are posted to. When specifying this value, take into account the following cases:

Uploading to Several URLs

You can specify several URLs in this property to upload files to several servers. In this case you should specify these URLs separated by a semicolon character (;):

URL1;URL2;URL3;...

Using Quotation Marks and Semicolons

URLs can contain semicolon or quotation mark characters (like this one: http://upload.server.com/uploadFile;jsessionid=123?param='value'). If so, to avoid parameter parsing errors enclose such URLs in single (' ') or double (" ") quotes. Additionally, quotation marks (both single ' and double ") inside URLs should be escaped with a backslash:

"http://upload.server.com/uploadFile;jsessionid=123?param=\'value\'"

Uploading to the Same Page

If you want to submit files to the same page Image Uploader is hosted on, specify the dot character (.) as a value of this property.

Default value is ".".

Remarks

Image Uploader is just an ActiveX control / Java applet which does not save files on server disk by itself. It just submits these files to a page specified by this URL (as a HTTP POST request in standard multipart/form-data format defined by RFC1867). That page should contain the server code which parses this POST request, saves files to necessary folders on server and performs any other additional actions.

Note

Usually this URL must have a specific extension (depending on the web server settings). For ASP platform it should be .asp, for ASP.NET the extension is .aspx, for PHP it is .php, for Perl it can be .pl or .cgi, etc. In other words, the file containing this script should have the extension registered in the settings of your web server as a server page. Otherwise upload will fail.

Image Uploader SDK includes a number of code samples for different server platforms:

Using Absolute and Relative URLs

URLs can be both absolute (e.g. iu.addParam("Action", "http://domain.com/upload/upload.aspx")) and relative to the current page (e.g. iu.addParam("Action", "/upload/upload.aspx")).

For example, if Image Uploader is inserted to the http://domain.com/ImageUploader/default.aspx page, the relative URLs specified via this property will correspond to the following locations.

Specified URLExpected Location
"/upload/upload.aspx"http://domain.com/upload/upload.aspx
"./upload/upload.aspx"http://domain.com/ImageUploader/upload/upload.aspx
"upload/upload.aspx"http://domain.com/ImageUploader/upload/upload.aspx
"upload.aspx"http://domain.com/ImageUploader/upload.aspx
Uploading to Several URLs

If multiple URLs are specified, Image Uploader alternates them when submitting requests. E.g. if you specify three URLs and upload five files (each file in a separate package), the sequence will be the following:

  1. File 1 - URL 1
  2. File 2 - URL 2
  3. File 3 - URL 3
  4. File 4 - URL 1
  5. File 5 - URL 2

When a new upload session is started (i.e. the Send button is clicked again), the upload will begin from the URL which is next to the last one used (unless the user refreshes the page, of course). In the example discussed above, it will be URL 3.

Note

It is important to distinguish between the upload session, as it appear to the user, and the POST request sent by Image Uploader. Whole upload session can be divided into several requests, depending on the value of the FilesPerOnePackageCount property. Most typical case is when each file is sent in a separate request (i.e. FilesPerOnePackageCount = 1). In this case the server code located on the page specified with this property will be executed as many times as the files are sent by the user, like if the user selected each file one by one and upload them separately.

It is important to keep this in mind when you use such features as concurrent upload, automatic upload resuming, several destination URLs, etc.

See Also

Manual

Reference