# Getting the url of an image inside public folder

**URL:** https://discourse.roots.io/t/getting-the-url-of-an-image-inside-public-folder/25632
**Category:** sage
**Created:** 2023-07-10T11:35:05Z
**Posts:** 4

## Post 1 by @Elland_Pansensoy — 2023-07-10T11:35:06Z

I have a external js file named `acf-map.js` and i want to use the`map-pin.png` image inside the public folder,

```
var image = {
		url: '/wp-content/themes/npr2023/public/images/map-pin.png',
		// This marker is 19 pixels wide by 32 pixels high.
		size: new google.maps.Size(19, 32),
		// The origin for this image is (0, 0).
		origin: new google.maps.Point(0, 0),
		// The anchor for this image is the base of the flagpole at (0, 32).
		anchor: new google.maps.Point(0, 32)
	};
```

This throws an error, it cannot find the image url because image has a prefix after the build.

---

## Post 2 by @strarsis — 2023-07-10T13:11:30Z

You should be able to import those assets:

> **[JS modules | bud.js](https://bud.js.org/learn/modules/js-modules#importing-data)**
>
> Learn how to write JS modules for your bud.js app

---

## Post 3 by @Elland_Pansensoy — 2023-07-10T14:03:47Z

I already have this as my bud.config.js

```
app
    .entry('app', ['@scripts/app', '@styles/app'])
    .entry('editor', ['@scripts/editor', '@styles/editor'])
    .assets(['images', 'fonts',])
    .assets({
        from: app.path(`@scripts/custom/acf-map.js`),
        to: app.path(`public/js/acf-map.js`),
      });
```

But issue isi i want to use the image on my external js

---

## Post 4 by @strarsis — 2023-07-10T18:15:40Z

> [@Elland_Pansensoy](#):
>
> external js

So that external JavaScript file is not built by `bud`?  
You can copy files without hashing the filename ([example](https://discourse.roots.io/t/possibility-to-exclude-filename-filetype-from-bud-hash/24425/2)), so those URLs are stable and can be used in the external JavaScript.
