                         ".xls" "application/vnd.ms-excel"
                         ".xlsx" "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                         ".jpg" "image/jpeg"))
-        (header "Content-Length" (.length file))
-        (header "Last-Modified" (format-date (last-modified-date file)))
+        (header "Content-Length" content-length)
+        (header "Last-Modified" date)
         (header "Content-Description" "File Transfer")
         (header "Content-Disposition" (str "attachment; filename=\"" file-name file-extention "\""))
         (header "Content-Transfer-Encoding" "binary")

(ns export-server.utils.responce
  (:import (java.io File FileOutputStream))
  (:require [cheshire.core :refer :all])
  (:use ring.util.response
        [ring.util.time :only (format-date)]

      (header "Access-Control-Allow-Headers" "X-Requested-With")))

(defn file-success [byte-array file-name file-extention]
  (let [content-length (count byte-array)
        date (format-date (Date.))]
    (-> (response (ByteArrayInputStream. byte-array))
        (status 200)
        (content-type (case file-extention
                        ".svg" "image/svg+xml"
