Skip to content

Getting a file from a record in Go #4458

Answered by ganigeorgiev
ndarilek asked this question in Q&A
Discussion options

You must be logged in to vote

The record file operations will be simplified and documented better in the future, but for now here is one minimal example:

key := record.BaseFilesPath() + "/" + record.GetString("yourFileField")

fsys, _ := app.NewFilesystem()
defer fsys.Close()

blob, _ := fsys.GetFile(key)
defer blob.Close()

// do something with the blob reader...

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@danzilberdan
Comment options

@ganigeorgiev
Comment options

Answer selected by ndarilek
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants