ConvertAPI / convertapi-library-dotnet

A .NET library for the ConvertAPI
https://www.convertapi.com
Other
22 stars 8 forks source link

Non existing local files accepted as remote files #27

Open tomasr78 opened 3 years ago

tomasr78 commented 3 years ago

The code below throws an exception that the remote file because non-existing local files and paths are treated as remote files.

Status Code: InternalServerError
Response: {"Code":5008,"Message":"Unable to access the file. Call failed with status code
500 (Internal Server Error). Remote file C:\file\not\exist\testa.pdf"}
var convertApi = new ConvertApi("secret");
var sourceFile = @"C:\file\not\exist\testa.pdf";
var sourceFile2 = @"C:\file\not\exist\TestFiles\test2.pdf";

var mergeTask = await convertApi.ConvertAsync("pdf", "merge",
         new ConvertApiFileParam(sourceFile2),
         new ConvertApiFileParam(sourceFile));

var saveFiles = await mergeTask.Files.First().SaveFileAsync(@"C:\Projects\_temp\result.pdf");