Learn R Programming

zzlite (version 0.1.2)

zz_post: Post file to Zamzar endpoint

Description

Per default `zz_post()` assumes that you're doing development, thus using a development endpoint. Set parameter `prod` to `TRUE` to change this behavior.

Usage

zz_post(
  file = NULL,
  extension = NULL,
  usr = NULL,
  prod = FALSE,
  verbose = FALSE
)

Arguments

file

The path to the file you want to convert.

extension

The file type you want to convert to. E.g., `png`.

usr

The username/API key you are using. If not set, the function will check if a key exists as a `ZAMZAR_USR` variable in `.Renviron` and use that.

See: https://developers.zamzar.com/user

prod

Boolean deciding whether to use production or development endpoint. Defaults to `FALSE`.

verbose

Boolean deciding whether or not verbose status messages should be returned. Defaults to `FALSE`.

Value

A status message indicating either success or failure.

Details

On differences between endpoints, see: https://developers.zamzar.com/docs#section-Next_steps and https://developers.zamzar.com/docs#section-Rate_Limits

Please note that a Zamzar key passed as argument to `usr` takes precedence over a Zamzar key extracted from an `.Renviron`.

See Also

zz_format for a list of formats you can convert to.

Examples

Run this code
# NOT RUN {
# Per default zz_post uses the development endpoint.
zz_post(file = "avatar.emf", extension = "png")

# Setting prod parameter to FALSE is the same as above.
zz_post(file = "avatar.emf", extension = "png", prod = FALSE)

# You need to flip prod to TRUE if you want to use the production endpoint.
zz_post(file = "avatar.emf", extension = "png", prod = TRUE)

# Remember you can always pass a Zamzar key to the usr parameter if you don't
# want to use an .Renviron file.
zz_post(file = "avatar.emf", usr = "key", extension = "png", prod = TRUE)
 
# }

Run the code above in your browser using DataLab