From 6d7257156f6d24ac1776b5f93b128bf3030970ad Mon Sep 17 00:00:00 2001 From: nek0 Date: Mon, 18 Aug 2014 03:09:03 +0200 Subject: [PATCH] changed storage location of files --- .gitignore | 2 +- Handler/Activate.hs | 2 +- Handler/NewAlbum.hs | 2 +- Handler/Upload.hs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b58f08a..542d7e5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ yesod-devel/ cabal.sandbox.config .DS_Store *.swp -data* +static/data* diff --git a/Handler/Activate.hs b/Handler/Activate.hs index 006771a..befc858 100644 --- a/Handler/Activate.hs +++ b/Handler/Activate.hs @@ -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 diff --git a/Handler/NewAlbum.hs b/Handler/NewAlbum.hs index 134f12d..5372397 100644 --- a/Handler/NewAlbum.hs +++ b/Handler/NewAlbum.hs @@ -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 diff --git a/Handler/Upload.hs b/Handler/Upload.hs index eb32ada..83617e4 100644 --- a/Handler/Upload.hs +++ b/Handler/Upload.hs @@ -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)