@@ -60,7 +60,7 @@ public Client(
60
60
{
61
61
_endpoint = endpoint ;
62
62
_http = http ?? new HttpClient ( ) ;
63
-
63
+
64
64
_httpForRedirect = httpForRedirect ?? new HttpClient (
65
65
new HttpClientHandler ( ) {
66
66
AllowAutoRedirect = false
@@ -69,11 +69,11 @@ public Client(
69
69
_headers = new Dictionary < string , string > ( )
70
70
{
71
71
{ "content-type" , "application/json" } ,
72
- { "user-agent" , "AppwriteDotNetSDK/0.10.0 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})" } ,
72
+ { "user-agent" , "AppwriteDotNetSDK/0.10.1 (${Environment.OSVersion.Platform}; ${Environment.OSVersion.VersionString})" } ,
73
73
{ "x-sdk-name" , ".NET" } ,
74
74
{ "x-sdk-platform" , "server" } ,
75
75
{ "x-sdk-language" , "dotnet" } ,
76
- { "x-sdk-version" , "0.10.0 " } ,
76
+ { "x-sdk-version" , "0.10.1 " } ,
77
77
{ "X-Appwrite-Response-Format" , "1.6.0" }
78
78
} ;
79
79
@@ -252,7 +252,7 @@ private HttpRequestMessage PrepareRequest(
252
252
253
253
public async Task < String > Redirect (
254
254
string method ,
255
- string path ,
255
+ string path ,
256
256
Dictionary < string , string > headers ,
257
257
Dictionary < string , object ? > parameters )
258
258
{
@@ -301,7 +301,7 @@ public async Task<T> Call<T>(
301
301
var response = await _http . SendAsync ( request ) ;
302
302
var code = ( int ) response . StatusCode ;
303
303
304
- if ( response . Headers . TryGetValues ( "x-appwrite-warning" , out var warnings ) )
304
+ if ( response . Headers . TryGetValues ( "x-appwrite-warning" , out var warnings ) )
305
305
{
306
306
foreach ( var warning in warnings )
307
307
{
@@ -408,15 +408,23 @@ public async Task<T> ChunkedUpload<T>(
408
408
409
409
if ( ! string . IsNullOrEmpty ( idParamName ) && ( string ) parameters [ idParamName ] != "unique()" )
410
410
{
411
+ try
412
+ {
411
413
// Make a request to check if a file already exists
412
414
var current = await Call < Dictionary < string , object ? > > (
413
415
method : "GET" ,
414
- path : "$ path/${params [idParamName]}",
415
- headers ,
416
- parameters = new Dictionary < string , object ? > ( )
416
+ path : $ " { path } / { parameters [ idParamName ] } ",
417
+ new Dictionary < string , string > { { "content-type" , "application/json" } } ,
418
+ parameters : new Dictionary < string , object ? > ( )
417
419
) ;
420
+
418
421
var chunksUploaded = ( long ) current [ "chunksUploaded" ] ;
419
422
offset = chunksUploaded * ChunkSize ;
423
+ }
424
+ catch ( Exception ex )
425
+ {
426
+ // ignored as it mostly means file not found
427
+ }
420
428
}
421
429
422
430
while ( offset < size )
0 commit comments