You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+106-1Lines changed: 106 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,4 +6,109 @@ A client for interacting with a Sia Skynet webportal.
6
6
7
7
## Usage
8
8
9
-
View the [wiki](https://github.com/drmathias/csharp-skynet/wiki) for instructions on how to use the package.
9
+
### Setup
10
+
11
+
This library targets [.NET Standard 2.0](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support), so can be used across various platforms. The webportal client is a [typed client](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests#typed-clients), that uses `System.Net.Http.HttpClient` to make HTTP requests.
This library uses `Microsoft.Extensions.FileProviders.Abstractions` (see [FileProviders](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/file-providers)) which allows you to upload from many file providers. There are several methods available to simplify uploading single files, multiple files and directories.
By default, the Skynet path of an uploaded file is set to the file name. This behaviour can be changed, by specifying the Skynet path on an `UploadItem`.
103
+
104
+
```csharp
105
+
newUploadItem(file, "/images/sunset.jpg")
106
+
// file will become available at https://siasky.net/{skylink}/images/sunset.jpg
107
+
```
108
+
109
+
For file uploads, the MIME type is automatically resolved based on the file extension. If you want to overwrite this behaviour, you can explicitly specify the MIME type on an `UploadItem`.
0 commit comments