storage-csharp icon indicating copy to clipboard operation
storage-csharp copied to clipboard

Error when uploading file bigger than 5GB

Open Kurounin opened this issue 3 months ago • 2 comments

Bug report

Describe the bug

When uploading a file which is bigger than 5GB, on the Pro Plan with a global limit of 20GB the following error is returned:

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
 at Newtonsoft.Json.JsonTextReader.ParseValue()
 at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
 at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
 at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
 at Supabase.Storage.Extensions.HttpClientProgress.UploadAsync(HttpClient client, Uri uri, Stream stream, Dictionary`2 headers, Progress`1 progress)
 at Supabase.Storage.StorageFileApi.UploadOrUpdate(String localPath, String supabasePath, FileOptions options, EventHandler`1 onProgress)
 at Supabase.Storage.StorageFileApi.Upload(String localFilePath, String supabasePath, FileOptions options, EventHandler`1 onProgress, Boolean inferContentType) 

This is triggered because the response is not a json but a 413 error from Cloudflare:

<html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>cloudflare</center>
</body>
</html> 

System information

  • Version of supabase-csharp: 0.16.1
  • Version of supabase-storage-csharp: 1.4.0

Kurounin avatar Mar 25 '24 17:03 Kurounin