{- | Add a new file to the system. -}
addFile :: Connection
        -> String               -- Disc ID
        -> String               -- File name
        -> Integer              -- File size
        -> String               -- md5
        -> String               -- MIME type
        -> IO ()
addFile conn discid fname fsize md5 mimetype = handleSqlError $
    execute conn $ "INSERT INTO mifiles VALUES (" ++
            (concat . intersperse ", " $ [toSqlValue discid,
                                          toSqlValue fname,
                                          toSqlValue fsize,
                                          toSqlValue md5,
                                          toSqlValue mimetype])
            ++ ")"
addFile :: Connection
        -> String               -- Disc ID
        -> String               -- File name
        -> Integer              -- File size
        -> String               -- md5
        -> String               -- MIME type
        -> IO ()
addFile conn discid fname fsize md5 mimetype = handleSqlError $
    execute conn $ "INSERT INTO mifiles VALUES (" ++
            (concat . intersperse ", " $ [toSqlValue discid,
                                          toSqlValue fname,
                                          toSqlValue fsize,
                                          toSqlValue md5,
                                          toSqlValue mimetype])
            ++ ")"
addFile conn discid fname fsize md5 mimetype = handleSqlError $
    execute conn $ "INSERT INTO mifiles VALUES (" ++
            (concat . intersperse ", " $ [toSqlValue discid,
                                          toSqlValue fname,
                                          toSqlValue fsize,
                                          toSqlValue md5,
                                          toSqlValue mimetype])
            ++ ")"