SyphtClient v0.1.0 SyphtClient.Upload View Source

Uploads files to Sypht.

Configuration

Override these defaults in the :sypht_client section of your config.exs files.

  • upload_url: "https://api.sypht.com/fileupload" - URL of file upload end point
  • upload_field_sets: ["sypht.generic"] - Sypht field set(s) to invoke (see https://docs.sypht.com/#section/Introduction)
  • upload_retry_on: [500] - Retry uploads on server HTTP status
  • upload_initial_backoff: 200 - Initial backoff milliseconds
  • upload_retry_until: 60_000 - Continue backing off and retrying until this many milliseconds have elapsed
  • upload_http_options: [ssl: [{:versions, [:"tlsv1.2"]}]] - Hackney HTTP options for uploads
  • upload_error_prefix: "SyphtUpload failed:" - Prefix upload error messages with this

Link to this section Summary

Functions

Uploads the file at path to Sypht using access_token. Returns {:ok, file_id} if successful, {:error, reason_string} otherwise.

Link to this section Functions

Link to this function

file(access_token, path)

View Source

Uploads the file at path to Sypht using access_token. Returns {:ok, file_id} if successful, {:error, reason_string} otherwise.