diff --git a/Handler/Upload.hs b/Handler/Upload.hs index 4fc1060..d2f218e 100644 --- a/Handler/Upload.hs +++ b/Handler/Upload.hs @@ -130,7 +130,9 @@ postDirectUploadR albumId = do fil <- return $ tempMediumFile temp case (fileContentType fil) `elem` acceptedTypes of True -> do - path <- writeOnDrive fil userId albumId + albRef <- runDB $ getJust (tempMediumAlbum temp) + ownerId <- return $ albumOwner albRef + path <- writeOnDrive fil ownerId albumId thumbPath <- generateThumb path ownerId albumId medium <- return $ Medium (tempMediumTitle temp)