changed storage location of files

This commit is contained in:
nek0 2014-08-18 03:09:03 +02:00
parent 07e9f9a213
commit 6d7257156f
4 changed files with 4 additions and 4 deletions

2
.gitignore vendored
View file

@ -12,4 +12,4 @@ yesod-devel/
cabal.sandbox.config
.DS_Store
*.swp
data*
static/data*

View file

@ -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

View file

@ -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

View file

@ -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)