content lengths specified.

This commit is contained in:
2022-07-12 06:34:52 -07:00
parent bb6592bd71
commit ab51d77384
7 changed files with 25 additions and 17 deletions

View File

@@ -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

View File

@@ -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