You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the library when passing multiple files to the converter. For example, DOCX to Compare conversion takes two files as parameters: File and CompareFile. The File parameter is interpreted as a file and sent to CARA as a file object. My guess is that the CompareFile is sent as a plain string (path to file) rather than the file itself. Conversion results in the following error:
data: {Code: 5008,Message: 'Unable to access the file. Call failed with status code 500 (Internal Server Error). Remote file C:/Projects/stuff/Test projects/ConvertAPI NodeJs/file-2.docx'}
Please note that there might be more conversions that accept multiple files as parameters, for example PDF watermark overlay (https://www.convertapi.com/pdf-to-watermark-overlay), so hardcoding the logic based on property name is not a good idea.
The current implementation doesn't have a property type to indicate what parameter type it is, File or String param.
I suggest doing a string comparison. If the property name is File or ends with *File it should consider as a File parameter.
This is a small list of File parameters in ConvertAPI, just an example to show that all file parameters end with a File string in the name.
@tomasr78 matching the end of the string with File sounds like a simple solution, but there are params like StoreFile - it would match the expression. Is it ok to make the exception for StoreFile or rather make a list of file params, like File, CompareFile, OverlayFile? Also are there more cases of Files (multiple files) params?
@laurynas-baltsoft It would be best to make an exception for the StoreFile parameter, as converters with File parameters may grow over time and we can't know all of them now.
Activity
tomasr78 commentedon Jul 10, 2023
The current implementation doesn't have a property type to indicate what parameter type it is,
FileorStringparam.I suggest doing a string comparison. If the property name is File or ends with *File it should consider as a File parameter.
This is a small list of
Fileparameters in ConvertAPI, just an example to show that all file parameters end with aFilestring in the name.laurynas-convertapi commentedon Jul 15, 2023
@tomasr78 matching the end of the string with
Filesounds like a simple solution, but there are params likeStoreFile- it would match the expression. Is it ok to make the exception forStoreFileor rather make a list of file params, likeFile,CompareFile,OverlayFile? Also are there more cases ofFiles(multiple files) params?tomasr78 commentedon Jul 15, 2023
@laurynas-baltsoft It would be best to make an exception for the
StoreFileparameter, as converters withFileparameters may grow over time and we can't know all of them now.