directus-dart icon indicating copy to clipboard operation
directus-dart copied to clipboard

while uploadFile(filePath) it gets uploaded but some parsing error

Open reev-create opened this issue 2 years ago • 2 comments

Getting this error ⬇️ type 'String' is not a subtype of type 'int?' in type cast while uploading file via 'uploadFile' method but it successfully uploads but throws error while parsing the response

reev-create avatar Jun 29 '22 14:06 reev-create

mostly occurring from the filesize field type as the server sends it as a String? but package defines it as int?

https://github.com/apstanisic/directus-dart/blob/ec87f59f5260470a06f9672dddc1baf962a8b85d/lib/src/modules/files/directus_file.dart#L46

reev-create avatar Jun 29 '22 14:06 reev-create

It should return int for file size based on Directus docs

I do not want to add another dependency for mime type, it's out of the scope of this package. It should be up to the user to parse them.

Sure, check any issue with "enhancement" or "bug" label, and create a PR

apstanisic avatar Jun 29 '22 18:06 apstanisic

Should be fixed, please try latest version. Reopen if exception still exists

apstanisic avatar Jan 10 '23 18:01 apstanisic