This is my first time using Os.Open and I was wondering can I use that for dynamic images (Images found in different directories) or do I have to put the full path every single time ? For instance in my FormFile
func ExampleFunc(w http.ResponseWriter, t *http.Request) {
t.ParseForm()
f, h, err := t.FormFile("file")
if err != nil {
print(err) }
os.Open(h.Filename)
}
The function above gives me an error no such file or directory found however if I put the full path in there such as
os.Open("/Home/myfiles/Documents/pictures/horse_riding.png")
Then the image opens, is there a way of dynamically get the Image path and inserting that in os.Open ? I do have a FormFile that gets information about the incoming file but not the full path .