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

Binary Responses #68

Open
ecc521 opened this issue Jun 10, 2021 · 2 comments
Open

Binary Responses #68

ecc521 opened this issue Jun 10, 2021 · 2 comments

Comments

@ecc521
Copy link

ecc521 commented Jun 10, 2021

Is there any way to send binary data (like images) using this plugin? It appears that only text is supported (sending an arrayBuffer resulted in sigterm)

@edsonlb
Copy link

edsonlb commented Nov 7, 2024

I'm in 2024, and have the same question.
I tried "reader.readAsArrayBuffer" and also "reader.readAsDataURL" as base64, but none worked.

Did you had any success?

@edsonlb
Copy link

edsonlb commented Nov 8, 2024

Made this one and worked!
window.resolveLocalFileSystemURL(fullPath, function(entry) { var contentType = getContentType(fullPath); webserver.sendResponse( request.requestId, { status: 200, path: entry.toURL().replace(/^file:\/\//, ''), // REMOVING FILE:// FROM PATH! headers: { 'Content-Type': contentType } } ); }

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

2 participants