changed storage location of files
This commit is contained in:
parent
07e9f9a213
commit
6d7257156f
4 changed files with 4 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,4 +12,4 @@ yesod-devel/
|
|||
cabal.sandbox.config
|
||||
.DS_Store
|
||||
*.swp
|
||||
data*
|
||||
static/data*
|
||||
|
|
|
@ -14,7 +14,7 @@ getActivateR token = do
|
|||
redirect $ HomeR
|
||||
Just x -> do
|
||||
userId <- runDB $ insert $ tokenUser (entityVal x)
|
||||
liftIO $ createDirectoryIfMissing True $ "data" </> (unpack $ extractKey userId)
|
||||
liftIO $ createDirectoryIfMissing True $ "static" </> "data" </> (unpack $ extractKey userId)
|
||||
runDB $ delete (entityKey x)
|
||||
setMessage $ "User activated"
|
||||
redirect $ HomeR
|
||||
|
|
|
@ -28,7 +28,7 @@ postNewAlbumR = do
|
|||
case result of
|
||||
FormSuccess album -> do
|
||||
albumId <- runDB $ insert album
|
||||
liftIO $ createDirectory $ "data" </> (unpack $ extractKey userId) </> (unpack $ extractKey albumId)
|
||||
liftIO $ createDirectory $ "static" </> "data" </> (unpack $ extractKey userId) </> (unpack $ extractKey albumId)
|
||||
setMessage $ "Album successfully created"
|
||||
redirect $ ProfileR userId
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ postUploadR = do
|
|||
writeOnDrive :: FileInfo -> UserId -> AlbumId -> Handler FilePath
|
||||
writeOnDrive file userId albumId = do
|
||||
filename <- return $ fileName file
|
||||
path <- return $ "data"
|
||||
path <- return $ "static" </> "data"
|
||||
</> (unpack $ extractKey userId)
|
||||
</> (unpack $ extractKey albumId)
|
||||
</> (unpack filename)
|
||||
|
|
Loading…
Reference in a new issue