The function is only instantiated once, so there is no point in keeping it in a template file.
Attach a file by drag & drop or click to upload