forked from loicteixeira/gj-unity-api
-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
I have tested uploading a 2MB worth of junk data. At first, I used the default method it offers.
using (var fileStream = new FileStream(string.Format(DirectoryService.MusicContentDirectoryFormat, DirectoryService.ContentDirectory).ResolveFullPath() + "/Some2MBMusicFile.ogg", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
using (var memoryStream = new MemoryStream())
{
fileStream.CopyTo(memoryStream);
var data = Convert.ToBase64String(memoryStream.ToArray());
DataStore.SetSegmented("test", data, true, a => Debug.Log(a), b => Debug.Log(b));
}
}
I edited the response error handler a little to get me a better error unity throws: (Unity really need to improve that lol) response.downloadHandler.text > Instead of response.error
It would still throw "413 (Request Entity Too Large)". However, now that I specify a smaller segment size, let say DataStore.SoftLimit / 2. It works!
The method still works for smaller data less than 1MB but it seems like the segment size isn't optimal enough to be used for bigger files without specifying a smaller default segment size.
So in summary, this soft limit could be improved further. If I can find an optimal value, I would let you know.
Metadata
Metadata
Assignees
Labels
No labels