# `Noizu.Slack.Files`
[🔗](https://github.com/noizu-labs-sdks/elixir-slack/blob/v0.1.0/lib/noizu/slack/files.ex#L1)

File uploads via Slack's external upload flow (the legacy `files.upload` method is
retired):

  1. `files.getUploadURLExternal` (`filename`, `length`) → `upload_url`, `file_id`
  2. the bytes are sent to `upload_url` (no bot token — the URL is pre-signed)
  3. `files.completeUploadExternal` (`files`, `channel_id`, `initial_comment`,
     `thread_ts`) shares the file

    Files.upload(client, "C123", %{filename: "report.csv", content: csv, title: "Report"})
    Files.upload(client, "C123", %{path: "/tmp/chart.png", thread_ts: ts})

Pass `channel = nil` to upload without sharing.

## Options

  * `:upload_method` — HTTP method for step 2: `:post` (default, per Slack docs) or `:put`.
  * `:alt_txt`, `:snippet_type` — forwarded to step 1.
  * request keys `:token`, `:headers` as for every call.

# `upload`

```elixir
@type upload() :: %{
  optional(:filename) =&gt; String.t(),
  optional(:content) =&gt; iodata(),
  optional(:path) =&gt; Path.t(),
  optional(:title) =&gt; String.t(),
  optional(:initial_comment) =&gt; String.t(),
  optional(:thread_ts) =&gt; String.t()
}
```

# `upload`

```elixir
@spec upload(
  Noizu.Slack.Client.t(),
  String.t() | nil,
  upload() | keyword(),
  keyword()
) ::
  Noizu.Slack.Request.result()
```

POST files.getUploadURLExternal → upload → files.completeUploadExternal — uploads and shares a file.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
