Skip to content

Cannot buffer large files (video etc.) while downloading #300

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

Closed
libersoft-org opened this issue Nov 10, 2023 · 2 comments
Closed

Cannot buffer large files (video etc.) while downloading #300

libersoft-org opened this issue Nov 10, 2023 · 2 comments
Labels
blocking Blocked by other issues

Comments

@libersoft-org
Copy link

libersoft-org commented Nov 10, 2023

I have a problem with serving a static file through Elysia like this:

app.get('/download/:hash/:name', async (req) =>{
 const file = Bun.file(path.join(dirDownload, req.params.hash));
 new Response(file, {
  headers: {
   'Content-Type': 'application/octet-stream',
   'Content-Disposition': 'attachment; filename="' + req.params.name + '"'
  }
 });
});

I cannot play big video files (in "video" HTML tag on frontend) before it's 100% of the file buffered (completely downloaded) - this does not happen in Express.js using res.sendFile, only in Bun + Elysia... Any idea on how to buffer big files? There is nothing like this in Elysia documentation.

@bogeychan
Copy link
Contributor

relates to elysiajs/elysia-static#19

@SaltyAom SaltyAom added the blocking Blocked by other issues label Nov 16, 2023
@SaltyAom
Copy link
Member

Fixed by 4ba3e85 published under 0.8.0.

Feel free to reopen the issue if the problem still persists.

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

No branches or pull requests

3 participants