mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-02 13:06:08 +02:00
Avatar image uploader
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user