Skip to content

Commit 35c43c9

Browse files
authored
Merge pull request #992 from appwrite/fix-dotnet-uploads
fix: dotnet uploads
2 parents 56e14bd + 4a9f874 commit 35c43c9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

templates/dotnet/Package/Client.cs.twig

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,23 @@ namespace {{ spec.title | caseUcfirst }}
380380

381381
if (!string.IsNullOrEmpty(idParamName) && (string)parameters[idParamName] != "unique()")
382382
{
383+
try
384+
{
383385
// Make a request to check if a file already exists
384386
var current = await Call<Dictionary<string, object?>>(
385387
method: "GET",
386-
path: "$path/${params[idParamName]}",
387-
headers,
388-
parameters = new Dictionary<string, object?>()
388+
path: $"{path}/{parameters[idParamName]}",
389+
new Dictionary<string, string> { { "content-type", "application/json" } },
390+
parameters: new Dictionary<string, object?>()
389391
);
390392
var chunksUploaded = (long)current["chunksUploaded"];
391393
offset = chunksUploaded * ChunkSize;
392394
}
395+
catch (Exception ex)
396+
{
397+
// ignored as it mostly means file not found
398+
}
399+
}
393400

394401
while (offset < size)
395402
{

0 commit comments

Comments
 (0)