C# Класс Qiniu.Storage.UploadManager

上传管理器,可以通过该上传管理器自动判断上传的内容是 采用表单上传还是分片上传。 对于二进制数据和文件流,目前仅支持表单上传 对于沙盒文件,目前支持以表单方式和分片方式上传
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
UploadManager ( ) : System

默认上传管理器

UploadManager ( ResumeRecorder recorder, KeyGenerator generator ) : System

以指定的分片上传进度记录器和分片上传记录文件名构建上传管理器 可以指定这两个参数来使分片上传支持断点续传功能

uploadData ( byte data, string key, string token, Qiniu.Storage.UploadOptions uploadOptions, UpCompletionHandler upCompletionHandler ) : void
uploadFile ( string filePath, string key, string token, Qiniu.Storage.UploadOptions uploadOptions, UpCompletionHandler upCompletionHandler ) : void
uploadStream ( Stream stream, string key, string token, Qiniu.Storage.UploadOptions uploadOptions, UpCompletionHandler upCompletionHandler ) : void

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

Метод Описание
DefaultUpCompletionHandler ( string key, Qiniu.Http.ResponseInfo respInfo, string respJson ) : void

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

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

默认上传管理器
public UploadManager ( ) : System
Результат System

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

以指定的分片上传进度记录器和分片上传记录文件名构建上传管理器 可以指定这两个参数来使分片上传支持断点续传功能
public UploadManager ( ResumeRecorder recorder, KeyGenerator generator ) : System
recorder Qiniu.Storage.Persistent.ResumeRecorder 分片上传进度记录器
generator KeyGenerator 分片上传进度记录文件名
Результат System

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

public uploadData ( byte data, string key, string token, Qiniu.Storage.UploadOptions uploadOptions, UpCompletionHandler upCompletionHandler ) : void
data byte
key string
token string
uploadOptions Qiniu.Storage.UploadOptions
upCompletionHandler UpCompletionHandler
Результат void

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

public uploadFile ( string filePath, string key, string token, Qiniu.Storage.UploadOptions uploadOptions, UpCompletionHandler upCompletionHandler ) : void
filePath string
key string
token string
uploadOptions Qiniu.Storage.UploadOptions
upCompletionHandler UpCompletionHandler
Результат void

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

public uploadStream ( Stream stream, string key, string token, Qiniu.Storage.UploadOptions uploadOptions, UpCompletionHandler upCompletionHandler ) : void
stream Stream
key string
token string
uploadOptions Qiniu.Storage.UploadOptions
upCompletionHandler UpCompletionHandler
Результат void