---
title: "Using Host and Upload Domains that Differ from One Another"
canonical: https://www.aurigma.com/docs/us8/using-host-and-upload-domains-that-differ-from-one-another.htm
product: "Upload Suite 8"
---

# Using Host and Upload Domains that Differ from One Another

Supported technologies: ![Adobe Flash](https://www.aurigma.com/docs/us8/icons/flash.png)
 
**Important** 
This article is applicable to Flash Uploader only. For similar information about the HTML5 Uploader see the [Enabling Cross-Origin Resource Sharing for HTML5 Uploader](https://www.aurigma.com/docs/us8/enabling-cross-origin-resource-sharing.htm.md) topic.
 
Usually Adobe Flash Player does not allow an swf application to access data that resides outside a domain where the application is hosted. It means that you usually cannot host Flash Uploader on one domain and upload files to another. However, you can manage this task by implementing cross-domain policy for Flash applications.

To allow Flash Uploader to upload files to some target server you should create the cross-domain policy file, named `crossdomain.xml`, and place it to the root folder of the target server.

Suppose, Flash Uploader is hosted in a `server1.com` server, whereas it requires to upload files to a `server2.com` server. In this case files should be placed as follows:

|   |  URL |
| --- | --- |
  |  the Flash control |  `http://server1.com/Scripts/aurigma.imageuploaderflash.swf` |
 |  a page where Flash Uploader is hosted |  `http://server1.com/default.html` |
 |  the cross-domain policy file |  `http://server2.com/crossdomain.xml` |
 |  an upload script; aimed to save files and/or get additional data |  `http://server2.com/upload.aspx` |
 
The cross-domain policy file have to be like in the snippet below:
```xml
<cross-domain-policy>
   <site-control permitted-cross-domain-policies="all"/>
   <allow-access-from domain="server1.com" to-ports="*"/>
   <allow-http-request-headers-from domain="server1.com" headers="*"/>
</cross-domain-policy>
```
And Flash Uploader should be configured like follows:
```aspx-cs
<aur:ImageUploaderFlash ID="Uploader1" runat="server" 
   LicenseKey="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX;YYYYY-YYYYY-YYYYY-YYYYY-YYYYY-YYYYYY">
   <UploadSettings ActionUrl="http://server2.com/upload.aspx" />
</aur:ImageUploaderFlash>
``````
<?php
   $uploader = new ImageUploaderFlash("Uploader1");
   $uploader->setLicenseKey("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX;YYYYY-YYYYY-YYYYY-YYYYY-YYYYY-YYYYYY");
   $uploader->getUploadSettings()->setActionUrl("http://server2.com/upload.php");
   $uploader->render();
?>
``````
 var fu = $au.imageUploaderFlash({id: 'Uploader1',licenseKey: "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX;YYYYY-YYYYY-YYYYY-YYYYY-YYYYY-YYYYYY",uploadSettings: { actionUrl:"http://server2.com/upload.asp" }
});
fu.writeHtml();
```
**Note** 
Pay attention that you will need a license key for the target domain too! So, you will need to [register two license keys](https://www.aurigma.com/docs/us8/registering-image-uploader-flash.htm.md): the first one for the domain where Flash Uploader is hosted, and the second one for the domain where files are uploaded to. See the [Registering HTML5/Flash Uploader](https://www.aurigma.com/docs/us8/registering-image-uploader-flash.htm.md) topic for more information.
 
## See Also
 
### Reference
 
- LicenseKey Property[LicenseKey (ASP.NET)](https://www.aurigma.com/docs/us8/FH_P_Aurigma_ImageUploaderFlash_ImageUploaderFlash_LicenseKey.htm.md)[LicenseKey (PHP)](https://www.aurigma.com/docs/us8/FH_P_P_ImageUploaderFlash_LicenseKey.htm.md)[licenseKey (JavaScript)](https://www.aurigma.com/docs/us8/FH_P_J_$au_imageUploaderFlash_licenseKey.htm.md)

### Manual
 
- [Registering HTML5/Flash Uploader](https://www.aurigma.com/docs/us8/registering-image-uploader-flash.htm.md)

### Other Resources
 
- [Cross-domain policy file specification↗](http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html)
- [Cross-domain policy file usage recommendations for Flash Player↗](http://www.adobe.com/devnet/flashplayer/articles/cross_domain_policy.html)
