Import a file from a URL into Mammoth
From URL creates a dataset from a file at a web address, so you don't download and re-upload it. In the Data Library, click New dataset, choose From URL, paste the link into Enter file URL and click Read file. It works with direct file URLs and with cloud storage URLs such as S3, Google Cloud Storage, Azure Blob Storage and Dropbox, with no other set-up.
When to import from a URL
From URL suits files at a web address that you refresh on demand or on a schedule: vendor or partner files published to a stable URL (for example, transaction CSV files a team categorizes and checks in pipelines, with nobody downloading or re-uploading), cloud storage files shared by public or signed URLs (such as production metrics exported to S3, imported without S3 permissions or manual transfers), and report servers that generate downloadable data files.
| Method | Best for | Pros | Cons |
|---|---|---|---|
| From URL | Files at a web address | No manual download, works with signed URLs, refreshes from the link | No separate authentication headers |
| File upload | Local files, or files with no stable, reachable URL | Immediate; 50 MB limit per file | Manual |
| Connectors | Database sources and application APIs, complex sign-ins, data that must flow both ways | Scheduled refresh, always current | Needs a connector set up |
| REST API connector | Custom integrations | Supports authentication headers and custom requests | Needs API set-up |
Create a dataset from a URL
- Go to the Data Library and select the project you want to add data to.
- Click New Dataset in the top right corner, and select From URL in the left-hand menu.
- Paste your direct file URL into the Enter file URL field.
- Click Read file. Mammoth shows a preview: the file name, where it comes from (such as From example.com), the number of rows and columns, and the first rows. A workbook with several tabs shows, for example, 3 tabs, each becomes a dataset, followed by the tab names.
- For a single CSV, TSV or TXT file, answer Should this dataset follow the link? (see the table). For other files, the window shows "A JSON or Excel file can't be fetched again from its link, so it is added once."
- Click Create new dataset.
| Option | What it does |
|---|---|
| Keep it linked (Recommended) | A live source. You can get the latest file from the link whenever you like. |
| Copy it once | Works like an uploaded file. The link is kept only as a note. |
You can change this later from the dataset's ⋮ menu (see Get the latest file from a linked URL). The dialog closes right away, and a placeholder row appears in the Data Library while the file downloads; time depends on the file size.
You can also paste a link into the search box of the Connectors launcher and choose Fetch this file.
Supported URLs and file types
The URL must:
- start with
http://orhttps://; - give a file name: Mammoth takes it from the
Content-Dispositionheader or the last segment of the URL path. A URL such ashttps://example.com/download?id=7with neither fails; - return the file itself, not an HTML page or a download landing page;
- point to a supported file type and be reachable when you import.
File types are the same as for file upload: .txt, .csv, .tsv, .psv, .xls, .xlsx, .xlsm, .xml, .json, .jsonl, .ndjson, .zip, .bz2, .gz, .tar, .7z, .pdf, .tiff, .tif, .jpeg, .jpg, .png, .heic, .heif, .webp. Only a CSV, TSV or TXT file can keep following its link. Other files are added once.
| Source | Example |
|---|---|
| Direct file URL | https://example.com/data/sales_report.csv, https://reports.company.com/Q1_2024.xlsx |
| Google Cloud Storage | https://storage.googleapis.com/bucket-name/monthly-data.csv |
| Azure Blob Storage | https://storageaccount.blob.core.windows.net/container/file.csv |
| Dropbox shared link | https://www.dropbox.com/s/abc123/data-export.csv?dl=1. Mammoth sets dl=1 for you, so the file downloads instead of the preview page. |
Import private files with a signed URL
Prefer HTTPS URLs (https://example.com/data.csv) over HTTP (http://example.com/data.csv). For private cloud storage, use signed URLs, which carry time-limited access in the URL itself. Mammoth fetches the file using the URL as given; From URL has no separate credential fields.
An AWS S3 signed URL looks like this (example format only, not a working URL):
https://bucket-name.s3.amazonaws.com/file.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=EXAMPLE&X-Amz-Date=20240315T120000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=EXAMPLE_SIGNATURE
A valid S3 signed URL must include all the X-Amz-* parameters; the base S3 URL without them returns an Access Denied error.
Limits
- Mammoth waits up to 9 seconds to connect and 27 seconds for the server to respond. A slower or unavailable server makes the import fail.
- Larger files take longer to download. If your source keeps producing very large files, ask the provider to compress them (gzip, zip) or split them into smaller parts.
- A time-limited signed URL must not have expired when you submit.
Troubleshooting URL imports
| Symptom | Cause | Fix |
|---|---|---|
| A warning under the URL field after Read file: the URL can't be reached | The URL changed or the file moved, a signed URL expired, or the file is temporarily unavailable. A wrong URL, expired link, timeout or refused connection all give the same error. | Open the URL in a browser and check it returns the file. Generate a fresh signed URL. Ask the data provider whether the URL is stable. |
| A warning under the URL field after Read file: a file problem | No file name in the URL path and no Content-Disposition header; the server returns audio, video or an HTML page; the extension doesn't match the content; or the format isn't supported | Make sure the URL returns the file itself, not a download or preview page, and that the format is in the list above |
| The same error as an unreachable URL, with access denied (the source answers 401 Unauthorized or 403 Forbidden) | The file isn't public, a signed URL expired, or the source needs authentication headers | Use a public URL or a valid signed URL. For header-based sign-in (Bearer tokens, Basic Auth), use the REST API connector, because From URL can't send separate authentication headers. |
| A placeholder row stays in the Data Library for a long time | The file is still downloading. This is expected. | Wait for it to finish. If it fails after a long wait, use a compressed version or split the file. |
Related
- Get the latest file from a linked URL: refresh, schedule and switch linked or copied.
- Upload files: supported formats and how files are read.
- Add or replace data in a dataset: how update methods add or replace rows.
- Connect a database or app: for APIs that need a sign-in.
Something wrong? support@mammoth.io