Class SqlTempFileStorageProvider

Represents sql table temporary file storage.

Inheritance
System.Object
SqlTempFileStorageProvider
Implements
System.IDisposable
Namespace: Mediachase.FileUploader.Web
Assembly: Mediachase.FileUploader.dll
Version: 10.8.0
Syntax
public class SqlTempFileStorageProvider : TempFileStorageProvider, IDisposable
Remarks

The SqlTempFileStorageProvider class is derived from the TempFileStorageProvider and is the default emporary file storage provider for Mediachase FileUploader.Net. The SqlTempFileStorageProvider class saves temporary file to folder.

Installation:

  • Create a new database.
  • Apply CreateSqlTempStorage.sql sql script. It creates mcfu_UploadedFiles table and storage procedures.
  • Add McSqlTempFileStorageProvider into tempFileStorage section.
  • Set McSqlTempFileStorageProvider as default provider.

Use connectionString attribute to define connection to temporary file storage database.

The following code example shows an example of an web.config file section with installed SqlTempFileStorageProvider:

<tempFileStorage defaultProvider="McSqlTempFileStorageProvider" enabled="true" timeout="60">
  <providers>
    <add name="McSqlTempFileStorageProvider" 
         type="Mediachase.FileUploader.Web.SqlTempFileStorageProvider, Mediachase.FileUploader" 
         description="" 
         connectionString="Data Source=(local); Initial Catalog=mcFileUploaderTempStorage;Integrated Security=SSPI;" />
  </providers>
</tempFileStorage>

Constructors

SqlTempFileStorageProvider()

Declaration
public SqlTempFileStorageProvider()

Properties

ConnectionString

Gets or sets the connection string.

Declaration
public string ConnectionString { get; set; }
Property Value
Type Description
System.String

The connection string.

Methods

CompleteStream(Guid)

Completes the stream.

Declaration
public override void CompleteStream(Guid StreamUid)
Parameters
Type Name Description
System.Guid StreamUid

The stream unique identifier.

Overrides

CreateStream(Guid, String, String, out Guid)

Creates the stream.

Declaration
public override Stream CreateStream(Guid SessionUid, string FileName, string ContentType, out Guid StreamUid)
Parameters
Type Name Description
System.Guid SessionUid

The session uid.

System.String FileName

Name of the file.

System.String ContentType

Type of the content.

System.Guid StreamUid

The stream unique identifier.

Returns
Type Description
System.IO.Stream
Overrides

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

GetFileStreamInfo(Guid)

Gets the stream info.

Declaration
public override FileStreamInfo GetFileStreamInfo(Guid StreamUid)
Parameters
Type Name Description
System.Guid StreamUid

The stream uid.

Returns
Type Description
FileStreamInfo
Overrides

GetFileStreamInfos(Guid)

Gets the stream info.

Declaration
public override FileStreamInfo[] GetFileStreamInfos(Guid SessionUid)
Parameters
Type Name Description
System.Guid SessionUid

The session uid.

Returns
Type Description
FileStreamInfo[]
Overrides

GetStream(Guid)

Gets the stream.

Declaration
public override Stream GetStream(Guid StreamUid)
Parameters
Type Name Description
System.Guid StreamUid

The stream uid.

Returns
Type Description
System.IO.Stream
Overrides

Initialize(String, NameValueCollection)

Initializes the specified name.

Declaration
public override void Initialize(string name, NameValueCollection config)
Parameters
Type Name Description
System.String name

The name.

System.Collections.Specialized.NameValueCollection config

The config.

Overrides

ReleaseSession(Guid)

Releases the stream.

Declaration
public override void ReleaseSession(Guid SessionUid)
Parameters
Type Name Description
System.Guid SessionUid
Overrides

ReleaseStream(Guid)

Releases the stream.

Declaration
public override void ReleaseStream(Guid StreamUid)
Parameters
Type Name Description
System.Guid StreamUid

The stream uid.

Overrides

Implements

System.IDisposable