blob: 3aa2ea69db3d4269e1c0e98c43b89dcf09e63e8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
const std = @import("std");
const Context = @import("../../context.zig");
const Storage = @import("../../../storage/root.zig");
const log = std.log.scoped(.image_upload);
pub const access = .users;
pub fn post(ctx: *Context) !void {
if (ctx.request.head.content_length) |length| {
var buffer: [1024]u8 = undefined;
const reader = try ctx.request.readerExpectContinue(&buffer);
try ctx.storage.images.add(ctx.storage, reader, length);
}
}
|