# How to import images in a custom code?

**URL:** <https://forum.readymag.com/t/how-to-import-images-in-a-custom-code/3338>\
**Category:** Custom code\
**Created:** [August 8, 2024, 12:59pm UTC](https://forum.readymag.com/t/how-to-import-images-in-a-custom-code/3338 "2024-08-08T12:59:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluesquare](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.readymag.com/bluesquare/32/2280_2.png) [@bluesquare](https://forum.readymag.com/u/bluesquare)\
**Post date:** [August 8, 2024, 12:59pm UTC](https://forum.readymag.com/t/how-to-import-images-in-a-custom-code/3338/1 "2024-08-08T12:59:30Z")

</div>

Hello everyone!

My question seems simple but I haven’t found a solution yet, I really hope you can help me.

I have created a custom carousel, and with it I have written code like this to import images like this:  
` "<img src="example.png" alt="Image 2">".`

But apart from importing an image with an existing URL, I have no idea how to import images from my laptop and have them hosted on Readymag in my custom carousel, just like in a normal carousel.

I’ve had 2 ideas to solve this problem, but none to get the images hosted on Readymag.

1. **Host it on Google Drive with a public link** : I’ve tried and it doesn’t seem possible to do this without an Iframe, so I can’t really put it in the carousel the way I want, it’s always surrounded by a weird UI.  
**2. Host it on a public site like Flickr** : This seems to work, but it’s a strange way of solving this problem, and I don’t like publishing the image twice, on Flickr and on the website.

Thanks in advance for your reply 🙂

---

<div class="post-metadata">

**Author:** ![neueMeta](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.readymag.com/neuemeta/32/92_2.png) [@neueMeta](https://forum.readymag.com/u/neueMeta)\
**Post date:** [August 9, 2024, 11:26am UTC](https://forum.readymag.com/t/how-to-import-images-in-a-custom-code/3338/2 "2024-08-09T11:26:45Z")

</div>

the most straight forward approach would be to host it on you own webserver. All domainproviders are offering a small webspace for a few bugs per month.  
You could then create a subdomain of your domain for example like: [images.yourdomain.com](http://images.yourdomain.com) and connect this to your webspace.  
If you now upload your image to the webspace they are reachable under [images.yourdomain.com/image1.jpg](http://images.yourdomain.com/image1.jpg).

you can then use this direct url in your carousel.
