Skip to content
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

[Firebase-storage][Android] Error: An unknown error occurred, please check the HTTP result code and inner exception for server response. #236

Open
GM-VF opened this issue Sep 18, 2023 · 1 comment

Comments

@GM-VF
Copy link

GM-VF commented Sep 18, 2023

Error: An unknown error occurred, please check the HTTP result code and inner exception for server response.

const file = File.fromPath(files.files[0], true);

gives me

"_path": "/storage/emulated/0/Download/877981_QSG_SSB600-SOUNDBAR_ml.pdf",
"_name": "877981_QSG_SSB600-SOUNDBAR_ml.pdf",
"_extension": ".pdf"

Upload

firebase()
.storage()
.ref()
.child(remoteFullPath)  // Firebase url
.putFile(localFullPath) // /storage/emulated/0/Download/877981_QSG_SSB600-SOUNDBAR_ml.pdf
.on('state_changed', {
    complete() {
        console.info('uploadFile', 'completed');
    },
    error(err) {
        console.error('uploadFile', 'error', err);
    },
    next(snapshot) {
        console.info('uploadFile', 'next', 'state', snapshot.state);
        if (snapshot.totalBytes) {
            console.log('uploadFile', 'next', 'progress %', snapshot.bytesTransferred / snapshot.totalBytes ?? 0 * 100);
        }
        if (snapshot.error) {
            console.error('uploadFile', 'next', snapshot.error);
        }
    },
});

Any ideas?

@GM-VF
Copy link
Author

GM-VF commented Sep 18, 2023

One thing I should add is that the above is the nativescript ui-document-picker. Using the nativescript-image picker if I create an image and store it in my app's directory the above works fine with the following url.

/data/user/0/org.nativescript.app/files/app-name/filename.ext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant