• Login

First, add the following property to your control:

Storage="azure"

<rmg:xile
  Storage="azure"
  Mode="document management"
  DMRootName="LeaseAgreement"
  DMSuffix="_v"
  Id="Files"
  AzureAccount="Account Name"
  AzureKey="Secret Key"
  AzureContainer="UserUploads"
  AzurePath='[[Join("SomePath/{0}", [[User:ID]])]]'
  DataField="Files"
  UploadMode="Single"
  AutoUpload="True"
  AcceptFileTypes="pdf"
  AllowedRoles="Registered Users">  
</rmg:xile>  
Document Management/Azure Example

When using "Document Management" mode, you can specify a forced naming convention for your uploads as well as a versioning suffix. For example, if using the above example if someone uploads a PDF called "Somefile.pdf" it'll be saved as LeaseAgreement_v1.pdf. If they upload again, it'll version and save the newest upload as LeaseAgreement_v2.pdf and so on.

The following table illustrates the property attributes that are required with the red border to the left as well as all extended options.

Property Usage
ID The Unique Identifier for your control.
Storage Must be set to Storage="azure"
Mode Must be set to Mode="document management"
DMRootName Files will be renamed according to the value specified for this property.
DMSuffix The DMSuffix will be appended to the DMRootName, or original file name if no DMRootName is specified. Do not use numbers for the DMSuffix. Example: DMSuffix="_v"
DataField This is the name of your DataField/Column in SQL that the file names will be stored in. Files are stored in a PIPE delimited format.
AzureAccount Your account name for your Azure Storage. (Ie. https://youraccount.blob.core.windows.net )
AzureKey This is your secret key from Azure. This key is encrypted when utilized by Xile.
AzureContainer This is the name of your container. Xile will also make this container public.
AzurePath Technically there are no folders within an Azure container, but Azure does allow a key/naming convention that allows you to mimic a folder structure. For example:

AzurePath='[[Join("UserImages/{0}/", [[User:ID]])]]'
AzureSaveOriginalContainer This can be used in conjunction with SaveOriginal="True". When using ResizeVersions Xile will first save the original file to the specified bucket, prepending with "orig_".
AzureSaveOriginalPath Technically there are no folders within an Azure container, but Azure does allow a key/naming convention that allows you to mimic a folder structure. For example:

AzurePath='[[Join("{0}", [[User:ID]])]]'
Nullable True|False - Determines whether or not a null value can be inserted into the database for your Datafield/Column.
UploadMode Multiple|Single - Use this in conjunction with the MaxNumberOfFiles property. If set to Single, it will only allow a single file to be selected within the popup dialog. If you still wish to use single, be sure to also set your MaxNumberOfFiles to 1.
AutoUpload True|False - If set to true, files are uploaded immediate after selection. Otherwise, they remain in preview mode and the user must click Start Upload.
AcceptFileTypes This defaults to disallow all file types. Take care to set this to protect your site. This property doesn't inherit from DNN's allowed file types. You have to set it manually. Separate your extensions without the period, like this: jpg,jpeg,png,pdf
AllowedRoles This defaults to "Administrators". To enable anyone to access the control's functions, change this to "All Users" although this is probably a bad idea. You can add multiple roles by separated them with a comma: (Ie. AllowedRoles="Registered Users, Something Else, And Something Else")
AllowDownload True|False - After the user uploads a file, they can re-download the file by clicking the thumbnail or filename.
AutoCreateFolder True|False - If the folder designated in your FileUploadPath doesn't exist, it will be created automatically if set to True.
ResizeVersions Empty by default - Xile uses ImageResizer when resizing images. Use the following format to create resized versions of your image:

ResizeVersions="width=800;height=600;format=jpg;mode=max, sm_:width=400;height=400;format=jpg;mode=max, thm_:width=50;height=50;format=jpg;mode=max"

Each version is separated by a "," comma. To prepend an image with some text, Xile looks for anything to the left of the ":" colon. It's also important that when using versions you create one version without using the "sm_:" prepend addition. This is the filename that's saved to the database, allowing you to access all the others later within your templates. (Ie: src="images/sm_[[ImageFile]]")

Hats off to ImageResizing.net as they've provided you with a huge variety of formatting options. View The Docs

What if I'm allowing more than images you ask? We've got you covered. Xile will only perform Versioning on image files and save other files a single time into the upload path.

Also, if you create at least one "thm_" version Xile will use this rendered thumbnail to display image confirmation after upload, saving you bandwidth.

Warning If using ResizeVersions with Azure, Xile will create a temporary folder on your server, perform resizing there, and then proceed by sending the files to Azure. Afterwards the temporary folder is removed. This does affect performance some and we would suggest using ImageResizer via query parameters instead so that images are resized dynamically when requested.
SaveOriginal True|False - If you want to save the original file uploaded in the original format that it was uploaded, set this to True. Xile will prepend the filename with "orig_" and place it in the upload folder. This property is ignored if ResizeVersions is empty and is currently intended for the purpose of images. Also, be sure to designate the path in SaveOriginalFilePath. Original files will be automatically prepended with "orig_".

Warning This has a small impact on performance. If you're saving the original and upload 5 files, it's just like uploading 10.
MaxNumberOfFiles Defaults to Unlimited - Enter a whole number value here to set the max files that can be added per instance.
MaxFileSize Max file size in bytes that can be uploaded. (Ie: 1048576 = 1MB)
MinFileSize Defaults to "1" byte - If you have a unique requirement that a file needs to be a certain size, you can enter it here in bytes.
AddFilesButtonText Setting this property will change the text for the Add Files button on the top button bar.
AddFilesButtonIcon Typical use would be to use a font/icon library but you can insert an image icon as well. (Ie: " ). We've included a link to FontAwesome in the demo form.
AddFilesButtonClass Setting this property will change the text for the Add Files button on the top button bar.
AddFilesButtonText You can override our default styles by adding your own class name here and styling accordingly. This is for the Add Files button on the top button bar.
StartUploadButtonText Setting this property will change the text for the Start Upload button on the top button bar.
StartUploadButtonIcon Typical use would be to use a font/icon library but you can insert an image icon as well. (Ie: " ). We've included a link to FontAwesome in the demo form.
StartUploadButtonClass You can override our default styles by adding your own class name here and styling accordingly. This is for the Start Upload button on the top button bar.
StartUploadButtonTextIndividual Setting this property will change the text for the Start Upload button for the individual files when using AutoUpload="False".
StartUploadButtonIconIndividual Typical use would be to use a font/icon library but you can insert an image icon as well. (Ie: " ). We've included a link to FontAwesome in the demo form.
StartUploadButtonClassIndividual You can override our default styles by adding your own class name here and styling accordingly. This is for the Start Upload button for individual files when using AutoUpload="False".
CancelUploadButtonText Setting this property will change the text for the Cancel Upload button on the top button bar.
CancelUploadButtonIcon Typical use would be to use a font/icon library but you can insert an image icon as well. We've included a link to FontAwesome in the demo form.
CancelUploadButtonClass You can override our default styles by adding your own class name here and styling accordingly. This is for the Cancel Upload button on the top button bar.
CancelUploadButtonTextIndividual Setting this property will change the text for the Cancel Upload button for the individual files when using AutoUpload="False".
CancelUploadButtonIconIndividual Typical use would be to use a font/icon library but you can insert an image icon as well. We've included a link to FontAwesome in the demo form.
CancelUploadButtonClassIndividual You can override our default styles by adding your own class name here and styling accordingly. This is for the Cancel Upload button for individual files when using AutoUpload="False".
DeleteButtonText Setting this property will change the text for the Delete button on the top button bar.
DeleteButtonIcon Typical use would be to use a font/icon library but you can insert an image icon as well. We've included a link to FontAwesome in the demo form.
DeleteButtonText Setting this property will change the text for the Delete button on the top button bar.
DeleteButtonClass You can override our default styles by adding your own class name here and styling accordingly. This is for the Delete button on the top button bar.
DeleteButtonTextIndividual Setting this property will change the text for the Delete button for the individual files after upload takes place.
DeleteButtonIconIndividual Typical use would be to use a font/icon library but you can insert an image icon as well. We've included a link to FontAwesome in the demo form.
DeleteButtonClassIndividual You can override our default styles by adding your own class name here and styling accordingly. This is for the Delete button for individual files after upload takes place.
ToggleCheckboxLabelText Setting this property will change the default text next to the checkbox on the top button bar.
WrapperClass You can change the class that the control is wrapped in, allowing you to style accordingly.
ErrorClass You can change the class that the control uses to display errors. This will affect how the text is displayed on error. (Ie. Max Files exceeded)
NonImageIcon When uploading non-image files, you can change the default icon that is displayed by setting the full path on this property.
ShowTopCancelButton True|False - Optionally hide the cancel button on the top button bar.
ShowTopDeleteButton True|False - Optionally hide the delete button on the top button bar.
ShowTopCheckBox True|False - Optionally hide the checkbox on the top button bar.
ShowTopProgressBar True|False - Optionally hide the animated progress bar beneath the top button bar.
Dropzone True|False - Optionally hide the Dropzone area.
DropzoneText Optionally change the default dropzone text.
PreviewMaxWidth Resize the preview image via client-side on upload. If you're setting the preview width in your CSS this may cause a flicker. Use one or the other for best results.
PreviewMaxHeight Resize the preview image via client-side on upload. If you're setting the preview width in your CSS this may cause a flicker. Use one or the other for best results.
SequentialUploads True|False - Defaults to True. Uploads files one at a time for better user experience on multiple uploads. Previously the default was asynchronous.
DeleteButtonText Setting this property will change the text for the Start Upload button for the individual files when using AutoUpload="False".
AcceptFileTypesError Optionally change error message on invalid file type.
MaxNumberOfFilesError Optionally change error message when max files have been exceeded.
MaxFileSizeError Optionally change error message when max file size has been exceeded.
MinFileSizeError Optionally change error message when min file size has not been met.