ASP.NET File Upload Progress - Server side properties

OboutInc.FileUpload.FileUploadProgress properties
Name Description
propertyID String. Component ID.

Optional
propertyPreservePlace Bool. Indicates that place for this control will be preserved in the page.

Default "false". Optional

See also working example Preserve place .
propertyShowUploadedFiles Bool. Indicates that list of uploaded files names will be shown inside control.

Default "false". Optional

See also working example Show uploaded files names .
propertyRefreshPeriod Integer. Refresh period for getting current uploading status (milliseconds).

Default "100". Optional
propertyOnClientProgressRefreshed String. Client-side function called on every UploadFileProgress control refreshing.

By default no function is called. Optional

See also working example Client-side events handling and OnClientProgressRefreshed function page .
propertyOnClientProgressStopped String. Client-side function called before UploadFileProgress control closed.

By default no function is called. Optional

See also working example Client-side events handling .
propertyOnClientProgressStarted String. Client-side function called before UploadFileProgress control opened.

By default no function is called. Optional

See also working example Client-side events handling .
propertyOnClientSubmitting String. Client-side function called on Form submitting.

By default no function is called. Optional

See also working example Client-side events handling .
propertyOnClientFileCleared String. Client-side function called when file inputs with not allowed extensions have been cleared in the form.

By default no function is called. Optional

See also working example Allowed file extensions and sizes and OnClientFileCleared function page .
propertyOnClientFileRejected String. Client-side function called when server-side had detected and cut file with size exceeding defined maximum.

By default no function is called. Optional

See also working example Allowed file extensions and sizes and OnClientFileRejected function page .
propertyOnClientServerException String. Client-side function called when server-side exception occurs while HTTP request processing.

This function get only one parameter: Exception message.
By default no function is called. Optional

See Optional settings page .
propertyLocalizationFile String. Path to custom defined localization XML file.

By default internal (English) localization is used. Optional

See also working example Localization and Custom localization file page.
propertyStyleFile String. Path to custom defined styles CSS file.

By default internal styles are used. Optional

See also working example Another style and Custom style file page.
propertyFormClientID String. Client ID of Form where UploadFileProgress control should be registered.

By default the first Form in document is used. Optional
propertyTimeFormat String. Elapsed and estimated times format.

Default "%HOURS%:%MINUTES%:%SECONDS%s". Optional

See also working example Custom time format .
propertyAllowedFileFormats Collection of OboutInc.FileUpload.Format objects.
If it is empty then files of all extensions and sizes can be uploaded.
See below for details of OboutInc.FileUpload.Format class.

See also working example Allowed file extensions and sizes .
propertyInnerFiles Bool. Indicates access to uploaded files:
  • false - via Page.Request.Files property
  • true - via this control Files property
The Page.Request.Files collection is correctly populated only when this property is set to "false"

Default "false". Optional
propertyFiles OboutFileCollection. An object representing a collection of files uploaded by the client, in multipart MIME format.

The file collection is populated only when InnerFiles property of the control is set to "true"
propertyIgnoreStatusPanel New Bool. By default on submit, when StatusPanel controls are used and no files were selected for uploading, no full postback occurs and content of StatusPanel controls is updated only. If to set this property to "true", full postback occurs when no files were selected (like in case of StatusPanel controls absence).

Default "false". Optional
Object for AllowedFileFormats collection
OboutInc.FileUpload.Format properties
Properties SETTINGS
propertyExt String. Extension of file that is allowed for uploading. If it has "*" value then this entity describes behavior of files uploading for files whose extensions have not entities in the collection.

Optional
propertyMaxByteSize Int. Maximum size (bytes) of files with the given extension that can be uploaded.
If not set then file of any size can be uploaded.

Optional

Example.

<fup:FileUploadProgress runat="server" ShowUploadedFiles="true" >
    <AllowedFileFormats>
        <fup:Format Ext="gif" MaxByteSize="10240" />
        <fup:Format Ext="jpg" MaxByteSize="10240" />
        <fup:Format Ext="jpeg" MaxByteSize="10240" />
        <fup:Format Ext="png" MaxByteSize="10240" />
    </AllowedFileFormats>
</fup:FileUploadProgress>

Image files of fixed extensions and not exceeding 10kB can be uploaded here.

Example.

<fup:FileUploadProgress runat="server" ShowUploadedFiles="true" >
    <AllowedFileFormats>
        <fup:Format Ext="*" MaxByteSize="102400" />
    </AllowedFileFormats>
</fup:FileUploadProgress>

Files with any extension and not exceeding 100kB can be uploaded here.


OboutInc.FileUpload.OboutFileCollection is a collection of OboutInc.FileUpload.OboutPostedFile objects.

OboutInc.FileUpload.OboutPostedFile public properties and methods
Name Description
propertyContentLength Integer. Gets the size of an uploaded file, in bytes.
propertyContentType String. Gets the MIME content type of a file sent by a client.
propertyFileName String. Gets the fully qualified name of the file on the client.
propertyInputName String. Gets the name of <input> field in the posted form on the client.
propertyInputStream Stream. Gets a Stream object that points to an uploaded file to prepare for reading the contents of the file.
methodSaveAs(FilePath) Void. Saves the contents of an uploaded file to FilePath.

Example code

void Page_Load(object sender, EventArgs e)
{

if (Page.IsPostBack)

{

OboutFileCollection files = uploadProgress.Files;

uploadedFiles.Text = "";


for (int i = 0; i < files.Count; i++)

{

OboutPostedFile file = files[i];

string fileName = Path.GetFileName(file.FileName);


file.SaveAs(MapPath("/FileUploadProgress/Uploaded/"+fileName));


uploadedFiles.Text += " FileName: "+fileName;

uploadedFiles.Text += " ContentLength: "+file.ContentLength.ToString();

uploadedFiles.Text += " ContentType: "+file.ContentType;

uploadedFiles.Text += " InputName: \""+file.InputName;

uploadedFiles.Text += "<br/>";

}


if (uploadedFiles.Text.Length == 0)

uploadedFiles.Text = "no files";

}

}
...
<fup:FileUploadProgress
     ShowUploadedFiles="true"
     runat="server"
     ID="uploadProgress"
     InnerFiles="true"
/>
<asp:Label runat="server" id="uploadedFiles" Text="" />