cloudconvert / cloudconvert-dotnet

CloudConvert .NET SDK
Other
20 stars 15 forks source link

Upload task fails when filename contains UTF-8 characters #18

Open PontusMagnusson opened 1 year ago

PontusMagnusson commented 1 year ago

When trying to upload files, the task fails because filenames containing UTF-8 chars (for example "åäö") are serialized in a way that the CloudConvert jobs can't understand.

private async Task UploadFile(Response<JobResponse> job, byte[] fileData, string fileName)
{
    var uploadTask = job.Data.Tasks.FirstOrDefault(t => t.Name == "upload_file");

    await _cloudConvertApi.UploadAsync(uploadTask.Result.Form.Url.ToString(), fileData, fileName, uploadTask.Result.Form.Parameters);
}

If a file has the filename "Sverigesköld.eps" it fails with an "INVALID_FILENAME" because the filename sent to the API is "=?utf-8?B?U3ZlcmlnZXNrw7ZsZC5lcHM=?=".

josiasmontag commented 1 year ago

Can you check if #19 fixes this for you?

PontusMagnusson commented 1 year ago

@josiasmontag Yep, that seems to fix the issue! 👍