Avatar image uploader

This commit is contained in:
Natsumi
2021-04-01 08:29:05 +13:00
parent de5b38a616
commit 26fa43a311
4 changed files with 291 additions and 3 deletions
+14
View File
@@ -153,6 +153,20 @@ namespace VRCX
}
}
if (options.TryGetValue("uploadImagePUT", out object uploadImagePUT) == true)
{
request.Method = "PUT";
request.ContentType = "image/png";
var imageData = options["imageData"] as string;
byte[] sentData = Convert.FromBase64CharArray(imageData.ToCharArray(), 0, imageData.Length);
request.ContentLength = sentData.Length;
using (System.IO.Stream sendStream = request.GetRequestStream())
{
sendStream.Write(sentData, 0, sentData.Length);
sendStream.Close();
}
}
if (options.TryGetValue("uploadImage", out object uploadImage) == true)
{
request.Method = "POST";