jetzig-framework / jetzig

Jetzig is a web framework written in Zig
MIT License
579 stars 25 forks source link

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

Closed HongChenLuYuan closed 5 months ago

HongChenLuYuan commented 5 months ago

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

bobf commented 5 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 5 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 !