# How to attach images & videos to a post from the DunSocial CLI > Run dun media upload ./file --json, copy the asset id from the output, then pass it to dun posts schedule or publish with --media. Add --alt for alt text. LinkedIn takes images or exactly one video, & YouTube takes Shorts only. Updated: 2026-10-05. ## Upload first, attach second The CLI doesn't take a file path on the post command. You upload the file into the workspace gallery, get back an asset id, then reference that id. ```bash dun media upload ./photo.png dun media upload ./photo.png --alt "Product screenshot" --json dun media upload ./clip.mp4 --mime video/mp4 ``` The CLI asks for a presigned URL, uploads the file & completes the asset for you. Supported types include JPEG, PNG, GIF, WebP, MP4, MOV & WebM. ## Attach the asset to a post Take the id from the JSON output & pass it with `--media`: ```bash dun posts schedule \ --text "New shot" \ --accounts ACCOUNT_ID \ --media ASSET_ID \ --in 30m ``` You can pass more than one asset id where the platform allows several images. ## Add alt text at upload time The `--alt` flag stores alt text on the asset, so it travels with the image wherever you use it. That's easier than remembering to add it per post. Writing alt text at upload is a good habit for a team, because a reused image keeps its description. ## Platform rules for media - LinkedIn (personal & Company Pages) takes up to 20 images or exactly one video, never both. Video is MP4 or MOV up to 512 MB - YouTube publishes Shorts only: one vertical or square clip of 3 minutes or less, with width, height & duration on the asset - Pinterest Pins take exactly one image - Facebook Pages take text, one link or photos, with no video Run `dun posts validate` first to catch a mismatch before anything is queued. DunSocial enforces these rules when you validate or schedule, so a mismatch is reported before anything is queued. ## Manage uploaded media ```bash dun media list dun media get ASSET_ID dun media delete ASSET_ID --yes ``` Deleting asks for `--yes`, because it's destructive. DunSocial refuses to delete an asset that a published post still uses. ## Large files Images can be up to 8 MB, & video limits vary by platform. For a script, upload once & reuse the asset id across posts instead of uploading the same file repeatedly. DunSocial keeps every uploaded asset in the workspace gallery, so one upload can serve many posts. ## Related guides - [How to schedule a post with the DunSocial CLI](https://www.dunsocial.com/hub/dunsocial-cli-guides/how-to-schedule-a-post-with-the-dunsocial-cli.md) - [How to validate a post before publishing with the DunSocial CLI](https://www.dunsocial.com/hub/dunsocial-cli-guides/how-to-validate-a-post-before-publishing-with-the-dunsocial-cli.md) - [How to batch create social media content](https://www.dunsocial.com/hub/social-media-content-creation/how-to-batch-create-social-media-content.md) - [What social media content formats actually work?](https://www.dunsocial.com/hub/social-media-content-creation/what-social-media-content-formats-actually-work.md) ## About this document This is the Markdown representation of https://www.dunsocial.com/hub/dunsocial-cli-guides/how-to-attach-images-and-videos-to-a-post-from-the-dunsocial-cli. The HTML version of the same page is at the same URL. You can also request Markdown from any page by sending `Accept: text/markdown`. Machine-readable summary of the whole site: https://www.dunsocial.com/llms.txt ## Company - Product: DunSocial, https://www.dunsocial.com - Legal entity: THISUX PRIVATE LIMITED, Chennai, Tamil Nadu, India - Support: support@dunsocial.com - Open the app: https://app.dunsocial.com/login