content lengths specified.
This commit is contained in:
@@ -420,13 +420,15 @@
|
||||
(Long/parseLong))
|
||||
{:keys [filename tempfile]} files]
|
||||
(lc/with-context {:parsing-file filename}
|
||||
(log/info tempfile)
|
||||
(try
|
||||
(let [extension (last (str/split (.getName (io/file filename)) #"\."))
|
||||
s3-location (str "invoice-files/" (str (UUID/randomUUID)) "." extension)
|
||||
_ (s3/put-object :bucket-name (:data-bucket env)
|
||||
:key s3-location
|
||||
:input-stream (io/input-stream tempfile)
|
||||
:metadata {:content-type "application/pdf"})
|
||||
_ (s3/put-object (:data-bucket env)
|
||||
s3-location
|
||||
(io/input-stream tempfile)
|
||||
{:content-type "application/pdf"
|
||||
:content-length (.length tempfile)})
|
||||
imports (->> (parse/parse-file (.getPath tempfile) filename)
|
||||
(map #(assoc %
|
||||
:client-override client
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
:key (str "queries/" guid)
|
||||
:input-stream (io/make-input-stream (.getBytes body) {})
|
||||
:metadata {:content-type "application/text"
|
||||
:content-length (count (.getBytes body))
|
||||
:user-metadata {:note note}})
|
||||
{:body {:query body
|
||||
:id guid
|
||||
|
||||
Reference in New Issue
Block a user