jetzig-framework / jetzig

Jetzig is a web framework written in Zig
MIT License
457 stars 21 forks source link

I didn't find the upload file feature, what should I do? #89

Closed HongChenLuYuan closed 3 months ago

HongChenLuYuan commented 3 months ago

I didn't find the upload file feature, what should I do?

bobf commented 3 months ago

Hi, @HongChenLuYuan - you can access request.body for now, which will be the full form-encoded POST body.

I'm adding a Trello card now to formalise this in a nicer interface, I'll do a proof-of-concept and then update this issue once it's ready.

bobf commented 3 months ago

@HongChenLuYuan File upload is now implemented.

Example usage: https://github.com/jetzig-framework/jetzig/blob/main/demo/src/app/views/file_upload.zig#L14 Test example: https://github.com/jetzig-framework/jetzig/blob/main/demo/src/app/views/file_upload.zig#L32 And template with form: https://github.com/jetzig-framework/jetzig/blob/main/demo/src/app/views/file_upload/index.zmpl

I will update the docs ASAP (most likely this weekend).

Thanks for reporting this and please let me know if you hit any issues or have any other requests. Have a nice week !