Read an uploaded file
wp_read_upload_fileRead a file from the uploads directory (wp-content/uploads). Returns file, content (the raw file content as a string), bytes, file_size and offset. A file up to 2 MB is read whole; a larger one is refused with its size unless offset/length select a slice of at most 2 MB. A missing file is an error. AlphaBridge's own folders (ab-mcp-sessions, ab-mcp-exports, ab-mcp-undo) are refused. Raw filesystem access; administrators only (manage_options); runs only with the site's write access on. Attachment data is read by wp_get_media. Forwarded by AlphaBridge Connect to the one site this connection reaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path relative to the uploads directory, e.g. "2026/07/report.csv", as wp_list_uploads lists it; ".." and symlinked files are refused. | |
| length | No | Number of bytes to read, at most 2 MB per call. Default: up to 2 MB from offset when offset is above 0; otherwise the whole file, which a file over 2 MB is refused for (offset 0 needs a length to read a slice). | |
| offset | No | Byte offset to start reading from. Default 0. |