Search Results for

Show / Hide Table of Contents

# Interface IUploadService

Defines the high-level upload operations used by the Web Forms controls and handler. Implementations coordinate validation, storage, chunk assembly, and file retrieval.

###### Namespace: AjaxUploader.Services

###### Assembly: AjaxUploader.dll

##### Syntax

    public interface IUploadService

### Methods

#### CompleteChunkedUpload(string, string, int)

Completes a chunked upload by assembling the stored chunks into a final stored file.

##### Declaration

    UploadResult CompleteChunkedUpload(string uploadId, string fileName, int totalChunks)

##### Parameters

Type | Name | Description
--- | --- | ---
string | uploadId |
string | fileName |
int | totalChunks |

##### Returns

Type | Description
--- | ---
UploadResult |

#### CopyFile(Guid, string)

Copies a stored uploaded file to a new destination path.

##### Declaration

    void CopyFile(Guid fileGuid, string destinationPath)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | fileGuid |
string | destinationPath |

#### DeleteFile(Guid)

Deletes a stored uploaded file.

##### Declaration

    void DeleteFile(Guid fileGuid)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | fileGuid |

#### GetFileInfo(Guid)

Gets metadata for a stored uploaded file.

##### Declaration

    UploadedFileInfo GetFileInfo(Guid fileGuid)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | fileGuid |

##### Returns

Type | Description
--- | ---
UploadedFileInfo |

#### MoveFile(Guid, string)

Moves a stored uploaded file to a new destination path.

##### Declaration

    void MoveFile(Guid fileGuid, string destinationPath)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | fileGuid |
string | destinationPath |

#### OpenFile(Guid)

Opens a stored uploaded file for reading.

##### Declaration

    Stream OpenFile(Guid fileGuid)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | fileGuid |

##### Returns

Type | Description
--- | ---
Stream |

#### UploadChunk(string, int, int, string, long, Stream)

Saves one chunk of a chunked upload request. The upload session is identified by `uploadId` and tracked until completion.

##### Declaration

    UploadResult UploadChunk(string uploadId, int chunkIndex, int totalChunks, string fileName, long totalFileSize, Stream chunkStream)

##### Parameters

Type | Name | Description
--- | --- | ---
string | uploadId |
int | chunkIndex |
int | totalChunks |
string | fileName |
long | totalFileSize |
Stream | chunkStream |

##### Returns

Type | Description
--- | ---
UploadResult |

#### UploadFile(Stream, string, long, string)

Uploads a complete file in a single request. Returns an UploadResult that includes success state, file GUID, and error details.

##### Declaration

    UploadResult UploadFile(Stream fileStream, string fileName, long fileSize, string contentType = null)

##### Parameters

Type | Name | Description
--- | --- | ---
Stream | fileStream |
string | fileName |
long | fileSize |
string | contentType |

##### Returns

Type | Description
--- | ---
UploadResult |

#### ValidateFile(string, long)

Validates the file name and file size against current configuration rules. Returns null when the file is valid; otherwise returns an error message.

##### Declaration

    string ValidateFile(string fileName, long fileSize)

##### Parameters

Type | Name | Description
--- | --- | ---
string | fileName |
long | fileSize |

##### Returns

Type | Description
--- | ---
string |