We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
this is code in preview.vue
loadImage() { // if authorization required if (this.auth) { GET.preview( this.selectedDisk, this.selectedItem.path, ).then((response) => { const mimeType = response.headers['content-type'].toLowerCase(); const imgBase64 = Buffer.from(response.data, 'binary').toString('base64');
this.imgSrc = `data:${mimeType};base64,${imgBase64}`; });
.....
error: Uncaught (in promise) ReferenceError: Buffer is not defined at eval (Preview.vue?ae5e:134:1)
Buffer.from is a node.js type ???
The text was updated successfully, but these errors were encountered:
Hi @alexusmai
I am having the same the isssue. Would you please review that?
Thanks!
Sorry, something went wrong.
An alernative option to Buffer.from for the "components/modals/views/PreviewModal.vue" page which works fine in my case.
Buffer.from
--- const imgBase64 = Buffer.from(response.data, 'binary').toString('base64'); +++ const imgBase64 = this._arrayBufferToBase64(response.data);
Add the following function at method
_arrayBufferToBase64( buffer ) { let binary = ''; const bytes = new Uint8Array( buffer ); const len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode( bytes[ i ] ); } return window.btoa( binary ); }
No branches or pull requests
this is code in preview.vue
loadImage() {
// if authorization required
if (this.auth) {
GET.preview(
this.selectedDisk,
this.selectedItem.path,
).then((response) => {
const mimeType = response.headers['content-type'].toLowerCase();
const imgBase64 = Buffer.from(response.data, 'binary').toString('base64');
.....
error:
Uncaught (in promise) ReferenceError: Buffer is not defined
at eval (Preview.vue?ae5e:134:1)
Buffer.from is a node.js type ???
The text was updated successfully, but these errors were encountered: