Skip to content

Instantly share code, notes, and snippets.

@vinkla

vinkla/CDN.md

Last active Mar 1, 2021
Embed
What would you like to do?

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag-and-drop an image onto the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.

Example of uploading image to GitHub's CDN

@himelnagrana

This comment has been minimized.

Copy link

@himelnagrana himelnagrana commented Dec 6, 2017

Awesome and WOWsome!

@roskoff

This comment has been minimized.

Copy link

@roskoff roskoff commented May 9, 2018

🥇

@snowman

This comment has been minimized.

Copy link

@snowman snowman commented Jun 22, 2018

Sweet

@joernroeder

This comment has been minimized.

Copy link

@joernroeder 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 ohld commented Dec 2, 2018

WE NEED AN API FOR THAT.

@herrmanthegerman

This comment has been minimized.

Copy link

@herrmanthegerman 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 prensmiskin commented Feb 13, 2019

Teşekkürler harika adam.

@RabaaRubaye

This comment has been minimized.

Copy link

@RabaaRubaye 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 PAESSoon commented Apr 24, 2019

Awesome! Thank you!!

@MubinSayed

This comment has been minimized.

Copy link

@MubinSayed MubinSayed commented May 6, 2019

Thanks

@PotLid

This comment has been minimized.

Copy link

@PotLid 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 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 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 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 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 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

@NawalJAhmed

This comment has been minimized.

Copy link

@NawalJAhmed NawalJAhmed 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 devoirtechsandip commented Nov 21, 2019

Thanks for tip, it work like charm

@sanghuncheong

This comment has been minimized.

Copy link

@sanghuncheong sanghuncheong commented Dec 19, 2019

Thank you! This tip helps me a lot!

@mikedonnici

This comment has been minimized.

Copy link

@mikedonnici mikedonnici commented Dec 23, 2019

10 x 👍

@ajaxray

This comment has been minimized.

Copy link

@ajaxray ajaxray commented Dec 30, 2019

🎉 WOW!! Coolness overloaded!! 🎉

@lightdollars

This comment has been minimized.

Copy link

@lightdollars lightdollars commented Dec 30, 2019

very cool i like this

@lightdollars

This comment has been minimized.

Copy link

@lightdollars lightdollars commented Dec 30, 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>

this is even better thanks for the tip

@ajmainekhan

This comment has been minimized.

Copy link

@ajmainekhan ajmainekhan commented Jan 5, 2020

Thanks, I need this for my website

@xerosanyam

This comment has been minimized.

Copy link

@xerosanyam xerosanyam commented Jan 13, 2020

This is amazing
image

@brunotdantas

This comment has been minimized.

Copy link

@brunotdantas brunotdantas commented Feb 9, 2020

Thanks a lot =)

@Zeng95

This comment has been minimized.

Copy link

@Zeng95 Zeng95 commented Feb 27, 2020

Thank you!!

@sitthykun

This comment has been minimized.

Copy link

@sitthykun sitthykun commented Mar 18, 2020

Thank you so much

@azarboon

This comment has been minimized.

Copy link

@azarboon azarboon commented Mar 23, 2020

thanks

@molhokwai

This comment has been minimized.

Copy link

@molhokwai molhokwai commented Apr 1, 2020

Thanks a lot

@mdsrosa

This comment has been minimized.

Copy link

@mdsrosa mdsrosa commented Apr 20, 2020

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

I would like to know this as well. Does anybody @github know?

@ruimaruima

This comment has been minimized.

Copy link

@ruimaruima ruimaruima commented May 29, 2020

Thanks

@avble

This comment has been minimized.

Copy link

@avble avble commented Jun 6, 2020

Many thanks

@tanveer263

This comment has been minimized.

Copy link

@tanveer263 tanveer263 commented Jun 11, 2020

thanks for your help

@jarunm

This comment has been minimized.

Copy link

@jarunm jarunm commented Jun 11, 2020

Thanks for the help!

@SHREYAS1188

This comment has been minimized.

Copy link

@SHREYAS1188 SHREYAS1188 commented Jun 23, 2020

Thank you teacher @vinkla it helped it worked :))

@sosiristseng

This comment has been minimized.

Copy link

@sosiristseng sosiristseng commented Jul 7, 2020

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

I would like to know this as well. Does anybody @github know?

I'm not a GitHub guy but AFAIK, no, unless you call the support. So don't put sensitive images there.

See this thread on SO

The official documentation did not mention how to delete them, either.

@studmuffin30

This comment has been minimized.

Copy link

@studmuffin30 studmuffin30 commented Jul 16, 2020

can we upload svg as well ?

@thevickypedia

This comment has been minimized.

Copy link

@thevickypedia thevickypedia commented Jul 29, 2020

Works like a charm 👍

@sosiristseng

This comment has been minimized.

Copy link

@sosiristseng sosiristseng commented Jul 29, 2020

can we upload svg as well ?

Unfortunately, you can't. You could put it directly in the repository since svg's are text files as well.

@trozler

This comment has been minimized.

Copy link

@trozler trozler commented Aug 21, 2020

gg

@setia1yogi

This comment has been minimized.

Copy link

@setia1yogi setia1yogi commented Sep 3, 2020

helpfull

@IhwanID

This comment has been minimized.

Copy link

@IhwanID IhwanID commented Sep 3, 2020

Nice

@adityatyagijtg

This comment has been minimized.

Copy link

@adityatyagijtg adityatyagijtg commented Sep 16, 2020

For the ones who still couldn't do it, I have written a detailed article with screenshots:
Read Here

@copperreflections

This comment has been minimized.

Copy link

@copperreflections copperreflections commented Sep 30, 2020

Thank you, Appreciate it. I worked really well and increase the speed of my website.

@GhostCode83

This comment has been minimized.

Copy link

@GhostCode83 GhostCode83 commented Oct 2, 2020

@thevickypedia

This comment has been minimized.

Copy link

@thevickypedia thevickypedia commented Oct 2, 2020

@GhostCode83

Did you all mean to include me in these emails? I’m relatively new to GitHub. I wasn’t sure if I was following a someone’s gist or was accidentally placed in these emails.

Simply hit the Unsubscribe button on top

@sutharp777

This comment has been minimized.

Copy link

@sutharp777 sutharp777 commented Oct 3, 2020

great, I really love this, before I knew this, I always go and host image on some other hosting site like https://imgbb.com/, but it is really awesome for me from now.

@copperreflections

This comment has been minimized.

Copy link

@copperreflections copperreflections commented Oct 3, 2020

Hi Everyone,
I wonder if you could help. I changed the 3 image URLs that were listed in UX Blocks by going to text HTML edit. There is one logo image that was added on Appearance > Customize > Logo & Site Identity. I could not figure out how to change this so it gets served from github.com. Is the logo in a WordPress file that I can change the URL?
Thank you all.

@aviboy2006

This comment has been minimized.

Copy link

@aviboy2006 aviboy2006 commented Oct 8, 2020

This is really great things

@KTibow

This comment has been minimized.

Copy link

@KTibow KTibow commented Oct 8, 2020

Or just put them into the comment box on this gist!

@passwortknacker

This comment has been minimized.

Copy link

@passwortknacker passwortknacker commented Oct 9, 2020

Awesome! Thank you so much!

@waldens

This comment has been minimized.

Copy link

@waldens waldens commented Oct 18, 2020

Does it count as abuse? no offense, I personally dont care if it counts, but pretty many "good net friends" accused me of abusing free services offered by github and taught others to do so, when I posted on a forum recommending this way. so just curious, does it count? Has an github official stance been taken?

@KTibow

This comment has been minimized.

Copy link

@KTibow KTibow commented Oct 18, 2020

If it's for GitHub (like a README) then it doesn't count. If the forum has a built-in way to upload images, prefer that instead. What would you think if you were GitHub?

@waldens

This comment has been minimized.

Copy link

@waldens waldens commented Oct 18, 2020

@KTibow If I'm github, tbh it counts. this feature was designed to facilitate discussion on issues (at least on github's pages), not intended to be used by users on other sites, but github probably won't act until it's widely and excessively abused. Imgur would have been a great image hoster, but been blocked in my location, github seems a good alternative that's globally accessible and CDN accelerated.

@KTibow

This comment has been minimized.

Copy link

@KTibow KTibow commented Oct 18, 2020

try imgbb if imgur doesn't work

@cateyes99

This comment has been minimized.

Copy link

@cateyes99 cateyes99 commented Oct 21, 2020

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

I would like to know this as well. Does anybody @github know?

I'm not a GitHub guy but AFAIK, no, unless you call the support. So don't put sensitive images there.

See this thread on SO

The official documentation did not mention how to delete them, either.

Deleting uploaded images are really desired, as sometimes we do make mistakes and want a chance to fix it 🙄

@Meins321

This comment has been minimized.

Copy link

@Meins321 Meins321 commented Nov 13, 2020

Having no "delete" option is just stupid..

It creates data waste like nothing else

@KTibow

This comment has been minimized.

Copy link

@KTibow KTibow commented Nov 13, 2020

It's for free. Don't make too much noise, it's not like GitHub subscribed to this thread. Also what if you accidentally delete an image?

@petumazo

This comment has been minimized.

Copy link

@petumazo petumazo commented Dec 24, 2020

Bravo!!! thanks

@Sinamajidi

This comment has been minimized.

Copy link

@Sinamajidi Sinamajidi commented Jan 11, 2021

Thank You

@hernandoabella

This comment has been minimized.

Copy link

@hernandoabella hernandoabella commented Jan 23, 2021

Thanks 👍

@stdntuvmath

This comment has been minimized.

Copy link

@stdntuvmath stdntuvmath commented Jan 24, 2021

this doesn't work - thanks.

@hkraal

This comment has been minimized.

Copy link

@hkraal hkraal commented Feb 9, 2021

It's for free. Don't make too much noise, it's not like GitHub subscribed to this thread. Also what if you accidentally delete an image?

What if you accidentally pasted your clipboard content in a PR and the content was an image you copied earlier? I guess I have to contact support now to get it removed.

Edit: I'm impressed by support, 5 minutes after opening a ticket the image was removed 👍

@nehajeryal

This comment has been minimized.

Copy link

@nehajeryal nehajeryal commented Feb 9, 2021

Awesome!!! Thanks a ton

@KTibow

This comment has been minimized.

Copy link

@KTibow KTibow commented Feb 13, 2021

What if you accidentally pasted your clipboard content in a PR and the content was an image you copied earlier?

So you already posted your comment? You can delete comments.

@hkraal

This comment has been minimized.

Copy link

@hkraal hkraal commented Feb 13, 2021

What if you accidentally pasted your clipboard content in a PR and the content was an image you copied earlier?

So you already posted your comment? You can delete comments.

No just uploaded it by accident. No real harm done but surely content on the www which I did not intend to upload.

@KTibow

This comment has been minimized.

Copy link

@KTibow KTibow commented Feb 13, 2021

I don't think anybody's going to find it, it's not like it appears on search.

@hkraal

This comment has been minimized.

Copy link

@hkraal hkraal commented Feb 13, 2021

I don't think anybody's going to find it, it's not like it appears on search.

Probably not, but that doesn’t make it right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment