Intel471Ex. Downloader
(intel471_ex v0.2.0)
Copy Markdown
File downloader for Intel 471 Verity API using Req.
Summary
Functions
Downloads a file from Intel 471 Verity API.
Downloads a file from Intel 471 Verity API and automatically extracts the filename from the URL.
Functions
Downloads a file from Intel 471 Verity API.
Parameters
url: Full URL to the filedestination: Local path where the file should be savedconfig: Optional configuration override
Returns
{:ok, path}— Successful download with path to saved file{:error, reason}— Error with reason
Examples
{:ok, path} = Intel471Ex.Downloader.download_file(
"https://api.intel471.cloud/integrations/intel-report/v1/reports/report-id/download-as-pdf",
"/tmp/report.pdf"
)
@spec download_file_auto(String.t(), String.t(), map() | nil) :: {:ok, String.t()} | {:error, any()}
Downloads a file from Intel 471 Verity API and automatically extracts the filename from the URL.
Parameters
url: Full URL to the filedestination_dir: Directory where the file should be saved (default: "downloads")config: Optional configuration override
Returns
{:ok, path}— Successful download with path to saved file{:error, reason}— Error with reason
Examples
{:ok, path} = Intel471Ex.Downloader.download_file_auto(
"https://api.intel471.cloud/integrations/intel-report/v1/reports/report-id/download-as-pdf"
)
{:ok, path} = Intel471Ex.Downloader.download_file_auto(
"https://api.intel471.cloud/integrations/intel-report/v1/reports/report-id/download-as-pdf",
"output/pdfs"
)