-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor and add support Android 12+ #45
base: master
Are you sure you want to change the base?
Conversation
displayName: return file name with extension
Add support for new android sdk
Hi @MaximBelov , After the latest Pull request for refactoring is merged, I can't see the data field in ChooserResult. Previously we were using the data field to get the data array as blob and post it as FormData to our Http endpoint. This doesn't work anymore. Can you please advise on how we use this from now on. Can the documentation be updated. Thanks, |
Hi then upload the file with cordova-plugin-advanced-http |
Hi @MaximBelov , I included these in pacakge.json file In the code it shows me latest object/data types for ChooserResult, but when I do 'ionic build' and 'npx cap sync android' and run the app in phone, the debugger shows the old data types for ChooserResult. So when I'm accessing file.mimeType, it says mimeType is not defined and its not there in the ChooserResult object. In the npm site it says it was last published 3 years ago. Thanks, |
Hi Version of cordova-plugin-chooser from npm is outdated. Try fixed version from github "cordova-plugin-chooser": "git+https://github.com/MaximBelov/cordova-plugin-chooser.git#1.4.0-custom", |
Hi @MaximBelov , After I changed package.json to use this new version, I can see the new data types in the debug mode. But we still need to get blob data , as we are using Form Data and we don't want to add another plugin for http which is advanced http just for uploading files. I tried another method to get blob data using File.ReadAsArrayBuffer() from cordova-plugin-file, but this method doesn't resolve and it doesn't return the blob data. If we can add backward compatibility and add just the fileData field which has blob data to Chooser plugin, that would be great. It would save us a lot of time. Thanks, |
let resources = try url.resourceValues(forKeys:[.fileSizeKey]) | ||
let fileSize = resources.fileSize! | ||
print ("\(fileSize)") | ||
if(fileSize > maxFileSize){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is missing a != 0
check
No description provided.