Skip to content

Limit byte count when using stream:write_body_from_file #106

Closed
@cafehaine

Description

@cafehaine

Hi, Im creating something close to Ownctload/nextcloud in lua, and I'm trying to allow resuming of paused downloads.
The thing is, lua-http can send the end of a file with stream:write_body_from_file(file, timeout) by seeking the begining of the file, but there is no way to handle the second "part" of the range header, ie where to stop.
I know I don't really need it for what I want, but it would be great to add a way to stop sending bytes from a file after a certain amount of bytes. This would allow to fully implement the Range header and not just the "resume" part of it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions