diff --git a/db/files.go b/db/files.go index 90eaabe..44a3bd8 100644 --- a/db/files.go +++ b/db/files.go @@ -12,7 +12,11 @@ import ( // AddFile is used to add the md5 of a file name which is uploaded to our application // this will enable us to randomize the URL without worrying about the file names func AddFile(fileName, token, username string) error { - err := taskQuery("insert into files values(?,?,?,datetime())", fileName, token, username) + userID, err := GetUserID(username) + if err != nil { + return err + } + err = taskQuery("insert into files values(?,?,?,datetime())", fileName, token, userID) return err }