Skip to content

Files

form-fileupload

Example - Form File Upload

This example illustrates aah form file upload. It is easy to handle file uploads in aah. It works by calling (method) Req.SaveFile with form field name and destination path. The method returns file size on successful save.

fileSize, err := Req.SaveFile("userProfileImage", "/Users/jeeva/user-profile-uploads")

Get aah examples

git clone https://github.com/go-aah/examples.git aah-examples

Run this example

cd aah-examples/form-fileupload
aah run

Visit this URL

Home page includes the details of implemented functionality and has a button to choose file and upload. It is self explanatory.