Skip to content

Commit

Permalink
Use fs/copy instead of manually copying the image
Browse files Browse the repository at this point in the history
  • Loading branch information
egli committed May 13, 2024
1 parent fcfcfee commit 8376cb3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/clj/daisyproducer2/documents/images.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
;; make sure path exists
(fs/create-dirs (fs/parent absolute-path))
;; copy the contents into the archive
(with-open [in (io/input-stream tempfile)
out (io/output-stream (fs/file absolute-path))]
(io/copy in out))
(fs/copy tempfile absolute-path)
;; and store it in the db ...
(->
(db/insert-image {:document_id document-id :content (str path)})
Expand Down

0 comments on commit 8376cb3

Please sign in to comment.