Store files on GridFS

This commit is contained in:
Las Zenow 2013-04-12 01:05:40 +02:00
parent 64375b6de5
commit 05b641201c
8 changed files with 94 additions and 75 deletions

View file

@ -235,13 +235,12 @@ func storeHandler(w http.ResponseWriter, r *http.Request) {
continue
}
book := books[0]
path, err := StoreBook(book)
if err != nil {
sess.Notify("An error ocurred!", err.Error(), "error")
log.Println("Error storing book '", book.Title, "': ", err.Error())
continue
}
db.UpdateBook(id, bson.M{"active": true, "path": path})
db.UpdateBook(id, bson.M{"active": true})
titles = append(titles, book.Title)
}
if titles != nil {