Chunked |
This is preliminary documentation and is subject to change.
The ChunkedUploadSource type exposes the following members.
Name | Description | |
---|---|---|
ChunkedUploadSource(WikiSite, Stream) | Initialize an instance from a Stream. | |
ChunkedUploadSource(WikiSite, Stream, String) | Initialize an instance from a Stream. |
Name | Description | |
---|---|---|
DefaultChunkSize | The chunk size to be used when calling the StashNextChunkAsync overloads without explicitly specifying chunk size. | |
FileKey | When IsStashed is true, gets the filekey used for file upload. | |
FileName | The file name used in the stashing requests. | |
IsStashed | Determines whether the file has been stashed completely. | |
IsStashing | Determines whether a chunk is currently uploading for stashing. | |
Site | ||
SourceStream | The source stream containing the content to be uploaded. | |
TotalSize | Gets the total size of the file to be uploaded. | |
UploadedSize | Gets the size of the uploaded part of file. |
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
GetHashCode | Serves as the default hash function. (Inherited from Object) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
GetUploadParameters |
Gets the additional fields that will override the default action=upload parameters.
(Overrides WikiUploadSourceGetUploadParameters(SiteInfo)) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
StashNextChunkAsync | ||
StashNextChunkAsync(CancellationToken) | ||
StashNextChunkAsync(Int32) | ||
StashNextChunkAsync(Int32, CancellationToken) | Stash the next chunk in the stream. | |
ToString | Returns a string that represents the current object. (Overrides ObjectToString) |
Since uploading a huge file in a single HTTP POST can be unreliable, MW upload API also supports a chunked upload mode, where you make multiple requests with portions of the file. This is available in MediaWiki 1.20 and above, although prior to version 1.25, SVGs could not be uploaded via chunked uploading.
See https://www.mediawiki.org/wiki/API:Upload#Chunked_uploading .
Before you can use this class with UploadAsync(WikiSite, String, WikiUploadSource, String, Boolean, AutoWatchBehavior, CancellationToken), you need to stash the whole stream in chunks to the server with StashNextChunkAsync or its overloads.