cgi_filehandle(3)

πŸ’– cgi_filehandle(3) πŸ’–

okay bestie, welcome to the ClearSilver corner of the manual pages πŸŽ€ this one lives in section 3 and it's filed under cgi/cgi.h, so if you're the kind of girl who reads headers for fun (me, obviously πŸ’…), you already know the vibe.


✨ NAME ✨

cgi_filehandle β€” hand you a file pointer to an uploaded file πŸ—‚οΈβœ¨


🌸 SYNOPSIS 🌸

#include <cgi/cgi.h>

FILE *cgi_filehandle (CGI *cgi, const char *form_name);

that's it, that's the whole signature, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cgi β€” a pointer to a CGI struct that you allocated with cgi_init. it's giving "you gotta bring your own CGI object" energy πŸ’…
  • form_name β€” the form name that the file was uploaded as. and listen, queen, this is not the filename, okay? that's a whole different thing and the manpage is being very clear about it, so pay attention 🫑 (and if it's NULL, we're asking for the file handle for the PUT upload β€” yes ma'am, that's the special case πŸŽ€)

🌈 DESCRIPTION 🌈

so cgi_filehandle will return the stdio FILE pointer associated with a file that was uploaded using multipart/form-data πŸ“Žβœ¨

and the cute part: that FILE pointer is positioned at the start of the file when it's first available. so you're not gonna be like, mid-file wondering where you are β€” you start at the beginning, iconic behaviour honestly πŸ‘‘


πŸ’€ RETURN VALUE πŸ’€

None

...yes. literally None. that's what it says. the docs said what they said and I'm just the messenger πŸ™ˆ the function hands you a FILE * in the synopsis and then the RETURN VALUE section goes "None" β€” we don't question the ancients, we just cite them πŸ•―οΈ


πŸ‘‘ SEE ALSO πŸ‘‘

like, the entire friend group is here, fr fr 🌸:

cgi_debug_init(3), cgi_parse(3), cgi_destroy(3), cgi_js_escape(3), cgi_html_escape_strfunc(3), cgi_register_strfuncs(3), cgi_output(3), parse_rfc2388(3), cgi_url_validate(3), open_upload(3), cgi_cs_init(3), cgi_url_escape_more(3), cgi_html_strip_strfunc(3), cgi_neo_error(3), cgi_redirect(3), cgi_filehandle(3), cgi_register_parse_cb(3), cgi_url_escape(3), cgi_init(3), cgi_redirect_uri(3), cgi_cookie_clear(3), cgi_url_unescape(3), cgi_vredirect(3), cgi_display(3), cgi_html_ws_strip(3), cgi_error(3), cgi_cookie_set(3), cgi_text_html_strfunc(3), cgi_cookie_authority

(yes bestie, cgi_filehandle(3) is in its own SEE ALSO list. self-love, we stan πŸ’…βœ¨)


and that's the whole page, gorgeous 🫢 this one came from ClearSilver, dated 12 July 2007 β€” an absolute vintage era, and honestly the fact that a 2007 manpage is still out here serving is main character energy in itself πŸ‘‘πŸ’– go upload something cute ✨