Back to Resources

How to attach files on GitHub issues

Store a tiny SVG and text file via gh api, post image and link Markdown with --body-file, then prove stored syntax with gh issue view --json.

What this covers

You can attach images, videos, documents, and other supported files to issues, pull requests, and comments in the GitHub web UI. GitHub documents a separate path for attaching local images and videos with GitHub CLI; this how-to sticks to the browser flow from Attaching files.

Flowchart
4 linescompact
flowchart TD
    Select["Select File or Drag into Comment"] --> Upload["Asset Upload to GitHub CDN"]
    Upload --> Markdown["Formatted Markdown Attachment Link Generated"]
    Markdown --> Render["Rendered Preview (Image, Video player, or Download link)"]
Rendered from Mermaid source with the native ZeroLabs diagram container.

Attach a file in the browser

  1. Open the issue, pull request, or comment box where you want the file.
  2. Drag and drop the file into the comment box, or click Attach files below the issue comment box to browse and select a file.
  3. On a pull request, you can also use Attach files in the formatting bar above the comment box.
  4. Wait for the upload. GitHub inserts an anonymized URL for the file into the text field. See About anonymized URLs.

GitHub CLI can attach local images and videos from the command line; see Attaching files with GitHub CLI if you need that path.

Size limits

  • 10MB: images and gifs
  • 10MB: videos on free-plan user/org repositories
  • 100MB: videos on paid-plan user/org repositories
  • 25MB: all other files

Supported file types

Image and media (all contexts)

PNG (.png), GIF (.gif), JPEG (.jpg, .jpeg), SVG (.svg), video (.mp4, .mov, .webm).

Additional types (issue / PR / discussion comments, including organization discussions)

Documents: .pdf, Office (.docx, .pptx, .xlsx, .xls, .xlsm), OpenDocument (.odt, .fodt, .ods, .fods, .odp, .fodp, .odg, .fodg, .odf), rich text (.rtf, .doc).

Text and data: .txt, .md, .copilotmd, .csv, .tsv, .log, .json, .jsonc.

Development: .c, .cs, .cpp, .css, .drawio, .dmp, .html, .htm, .java, .js, .ipynb, .patch, .php, .cpuprofile, .pdb, .py, .sh, .sql, .ts, .tsx, .xml, .yaml, .yml.

Archives: .zip, .gz, .tgz.

Communication: .debug, .msg, .eml.

Extra images: .bmp, .tif, .tiff.

Audio: .mp3, .wav.

Quick checks

  • After upload, confirm the anonymized URL appeared in the Markdown field before you submit.
  • Prefer compressed formats when you are near the size caps.
  • Do not treat a public-repo upload URL as private.
Share