GOLF(2gg)
π GOLF(2gg) π
okay bestie, so this is the GOLF(2gg) page from the Development manual, and it's all about file-uploading π pull up a chair, we're doing files today.
β¨ NAME β¨
file-uploading β it's giving... files ποΈβ¨ (yes the original literally just says "(files)", iconic minimalism, we love her)
π― PURPOSE π―
Upload a file to server. That's it. That's the whole vibe. π«Ά
π¦ SYNTAX π¦
get-param <name>
π DESCRIPTION π
So, files that get uploaded by a client (think a browser, curl, whatever your fave is πΈ) β you grab them with get-param.
Golf uploads files via HTML automatically, meaning you do not have to write any code for that specific purpose. No cap. An uploaded file gets stored in file-storage, with the path and name of that file generated by Golf so it's unique β¨. For example, a file you upload might be named:
/var/lib/gg/app_name/app//file/d0/f31881
(yes, double slash and all, that's just how she is π )
When a file is uploaded, you can obtain the following input parameters β and for this example we're assuming the name attribute of the HTML input element is myfile:
"myfile_filename"is the name of the file as provided by the client. π"myfile_location"is the full path on the server where file is stored (such as"/var/lib/gg/app_name/app//file/d0/f31881"for example) π"myfile_ext"is the extension of the file, for example".jpg"or".pdf". Note that".jpeg"is always showing as".jpg". The extension is always lower case. π"myfile_size"is the size of the file uploaded, as a string. Seeggfor setting the maximum file upload size. π
For example, for an HTML form which is uploading a file named "myfile", such as
<input type='file' name='myfile'>
your code that handles this might be:
get-param myfile_filename
get-param myfile_location
get-param myfile_ext
get-param myfile_size
You have uploaded file <<p-web myfile_filename>> to a server file at <<p-web myfile_location>>
and that's the whole flow, main character energy from start to finish π
πΈ SEE ALSO πΈ
Fileschange-modeclose-filecopy-filedelete-filefile-positionfile-storagefile-uploadinglock-fileopen-fileread-fileread-linerename-filestat-filetemporary-fileuniq-fileunlock-filewrite-file- See all documentation
and that's the page, bestie!! this version is $VERSION, dated $DATE β go upload something cute π β¨π
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms