URL of the page to which files selected for upload in Image Uploader are sent to.
<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>
getImageUploader("ImageUploaderID").setAction(value); value = getImageUploader("ImageUploaderID").getAction();
A string that specifies the URL to the page files are posted to. When specifying this value, take into account the following cases:
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;...
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\'"
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 ".".
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.
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:
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 URL | Expected 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 |
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:
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.
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.