Skip to content

Instantly share code, notes, and snippets.

@vinkla vinkla/CDN.md
Last active Dec 14, 2019

Embed
What would you like to do?
A guide on how to upload images to GitHub's CDN through issue and pull request text fields.

Upload Images to GitHub's CDN

  1. First, visit any repository on GitHub and click your way through to the issues page.

  2. Create a new issue by clicking the New Issue button. You'll now see title and description fields.

  3. Drag-and-drop an image on to the description field. This will start the uploading process.

  4. Copy the URL and use it in README, issues or pull requests however you like.

Example of uploading image to GitHub's CDN

@himelnagrana

This comment has been minimized.

Copy link

himelnagrana commented Dec 6, 2017

Awesome and WOWsome!

@roskoff

This comment has been minimized.

Copy link

roskoff commented May 9, 2018

🥇

@snowman

This comment has been minimized.

Copy link

snowman commented Jun 22, 2018

Sweet

@joernroeder

This comment has been minimized.

Copy link

joernroeder commented Oct 9, 2018

github suggests docs or hidden .github folder in repo root https://help.github.com/articles/about-readmes/

@ohld

This comment has been minimized.

Copy link

ohld commented Dec 2, 2018

WE NEED AN API FOR THAT.

@herrmanthegerman

This comment has been minimized.

Copy link

herrmanthegerman commented Jan 15, 2019

Is there an UI to manage images that a user has uploaded, e.g., so that a user can delete an image?

@prensmiskin

This comment has been minimized.

Copy link

prensmiskin commented Feb 13, 2019

Teşekkürler harika adam.

@RabaaRubaye

This comment has been minimized.

Copy link

RabaaRubaye commented Mar 18, 2019

Thank you ... I spent an hour trying to do this following a youtube tutorial and I failed ... and finally I found you and I did it in 1 minute... thank you for saving my day.

@PAESSoon

This comment has been minimized.

Copy link

PAESSoon commented Apr 24, 2019

Awesome! Thank you!!

@MubinSayed

This comment has been minimized.

Copy link

MubinSayed commented May 6, 2019

Thanks

@PotLid

This comment has been minimized.

Copy link

PotLid commented May 24, 2019

This is by far the most intuitive and easy. Thanks mate!

@astout

This comment has been minimized.

Copy link

astout commented May 28, 2019

Does this suddenly no longer work for others? I drag and drop and chrome just opens the local file. Safari behavior just pastes in the path to the local file. On macOS 10.14.5.

Edit: Interesting...it works in comments, but no longer in Wiki.

@PotLid

This comment has been minimized.

Copy link

PotLid commented May 29, 2019

@astout

Same on my safari Mojave 10.14.5.

Seems only works on few cases.

@evertdespiegeleer

This comment has been minimized.

Copy link

evertdespiegeleer commented Jul 25, 2019

WE NEED AN API FOR THAT.

Now there is an API for that 😉

@AWinterman

This comment has been minimized.

Copy link

AWinterman commented Aug 15, 2019

WE NEED AN API FOR THAT.

Now there is an API for that 😉

To save others the click, there is not an api. The link takes you to a project that programmatically navigates to the issue page, inserts the image you want to upload, waits for it to finish uploading, and then returns the url. While it is literally a CLI, it's not something I would recommend coding against.

@maple3142

This comment has been minimized.

Copy link

maple3142 commented Aug 24, 2019

WE NEED AN API FOR THAT.

Now there is an API for that 😉

To save others the click, there is not an api. The link takes you to a project that programmatically navigates to the issue page, inserts the image you want to upload, waits for it to finish uploading, and then returns the url. While it is literally a CLI, it's not something I would recommend coding against.

I have a similar CLI project for that, and it doesn't use a browser(puppeteer) for that.
https://github.com/maple3142/ghfileupl

@NathanAllerton

This comment has been minimized.

Copy link

NathanAllerton commented Sep 4, 2019

Yes, this works quite well. If you ever want to center your image, you can use HTML tags. For example:

<p align="center">
<img src="Link you used by following the above tutorial.">
</p>

@devoirtechsandip

This comment has been minimized.

Copy link

devoirtechsandip commented Nov 21, 2019

Thanks for tip, it work like charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.