Skip to content

Empty string was printed after tostring() call #39

@ghost

Description

example.txt
Hi!
My file example.txt is attached.

local Multipart = require("multipart")
local io = require("io")
local open = io.open
local function read_file(path)
    local file = open(path, "r")
    if not file then return nil end
    local content = file:read "*a"
    file:close()
    return content
end
local body = read_file("example.txt");
local multipart_data = Multipart(body, "text/html")
local t = multipart_data:tostring()
print (t)

This code prints empty line. What's wrong? Please, explain it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions