C# Класс UploadExamples.Services.NetworkUploadService

Upload service for storing files locally on the network or server
Наследование: IUploadService
Показать файл Открыть проект

Открытые методы

Метод Описание
CancelUpload ( string fileName ) : void

Cancel the upload and delete the TEMP file

GetFileList ( ) : IEnumerable

Returns a list of the network files

GetFileStream ( string fileName, string path ) : Stream

Get a filestream for a local file on the server

NetworkUploadService ( string uploadLocation, string tempFolderName ) : System

Create a new instance of the network upload service.

StoreFileAdvanced ( string fileName, string path, Stream stream, string parameters, bool firstChunk, bool lastChunk ) : void

Stores the file advanced.

StoreFileAdvanced ( string fileName, string path, byte data, int dataLength, string parameters, bool firstChunk, bool lastChunk ) : void

Receive a chunk of data and store it on disk

Защищенные методы

Метод Описание
DeleteUploadedFile ( string fileName ) : void

Delete an uploaded file

FinishedFileUpload ( string fileName, string parameters ) : void

Do your own stuff here when the file is finished uploading

Приватные методы

Метод Описание
SaveFile ( Stream stream, FileStream fs ) : void

Saves the file.

StoreFile ( string fileName, string path, string parameters, bool firstChunk, bool lastChunk, Action storeAction ) : void

Stores the file using a generic store action for working with a filestream

Описание методов

CancelUpload() публичный Метод

Cancel the upload and delete the TEMP file
public CancelUpload ( string fileName ) : void
fileName string Name of the file.
Результат void

DeleteUploadedFile() защищенный Метод

Delete an uploaded file
protected DeleteUploadedFile ( string fileName ) : void
fileName string Name of the file.
Результат void

FinishedFileUpload() защищенный Метод

Do your own stuff here when the file is finished uploading
protected FinishedFileUpload ( string fileName, string parameters ) : void
fileName string Name of the file.
parameters string The parameters.
Результат void

GetFileList() публичный Метод

Returns a list of the network files
public GetFileList ( ) : IEnumerable
Результат IEnumerable

GetFileStream() публичный Метод

Get a filestream for a local file on the server
public GetFileStream ( string fileName, string path ) : Stream
fileName string The name of the file to stream back
path string The path
Результат Stream

NetworkUploadService() публичный Метод

Create a new instance of the network upload service.
public NetworkUploadService ( string uploadLocation, string tempFolderName ) : System
uploadLocation string The location to store files locally
tempFolderName string A temporary folder name to use for upload transfer
Результат System

StoreFileAdvanced() публичный Метод

Stores the file advanced.
public StoreFileAdvanced ( string fileName, string path, Stream stream, string parameters, bool firstChunk, bool lastChunk ) : void
fileName string Name of the file.
path string path to save to
stream Stream The stream.
parameters string The parameters.
firstChunk bool if set to true [first chunk].
lastChunk bool if set to true [last chunk].
Результат void

StoreFileAdvanced() публичный Метод

Receive a chunk of data and store it on disk
public StoreFileAdvanced ( string fileName, string path, byte data, int dataLength, string parameters, bool firstChunk, bool lastChunk ) : void
fileName string Name of the file.
path string the path to store the file
data byte The file's data.
dataLength int Length of the data.
parameters string The parameters.
firstChunk bool if set to true [first chunk].
lastChunk bool if set to true [last chunk].
Результат void