logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

file-uploading - (files)

Description

Files uploaded via client (such as a browser, curl etc.) are obtained via get-param. Golf uploads files via HTML automatically, meaning you do not have to write any code for that specific purpose. An uploaded file will be stored in file-storage, with path and name of such a file generated by Golf to be unique. For example, a file uploaded might be named "/var/lib/gg/app_name/app//file/d0/f31881". When file is uploaded, the following input parameters can be obtained, in this case assuming "name" attribute of 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. See gg for 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>>

Name

file-uploading - (files)

Purpose

Upload a file to server.

See Also

Files change-modeclose-filecopy-filedelete-filefile-positionfile-storagefile-uploadinglock-fileopen-fileread-fileread-linerename-filestat-filetemporary-fileuniq-fileunlock-filewrite-file See all documentation $DATE $VERSION GOLF(2gg)

Syntax

get-param <name>

See Also