# Importer: How to upload category logo images

**URL:** https://meta.discourse.org/t/importer-how-to-upload-category-logo-images/62003
**Category:** Development
**Created:** [02.Май.2017 22:14:04 UTC](https://meta.discourse.org/t/importer-how-to-upload-category-logo-images/62003 "2017-05-02T22:14:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [02.Май.2017 22:14:04 UTC](https://meta.discourse.org/t/importer-how-to-upload-category-logo-images/62003/1 "2017-05-02T22:14:04Z")

</div>

I’m adding group support to the Ning importer (right now Ning groups are ignored; a trivial change to import the groups results in group posts going into uncategorized).

It does this:

- Ning groups become Discourse groups and categories
- Ning group members go into Discourse groups (admins imported as owners)
- Ning Wall posts become a topic in the Category
- Ning discussions for the group are put in the proper Discourse category
- Read-only permission for everyone for the categories
- reply-create permission for group members in the categories

But that’s not important now.

Ning also has a icon for each group. I want that group to be the Category Logo Image. I don’t see uploaded\_logo\_id in any of the importers and a cursory look around the controllers hasn’t helped either.

Can someone point me to where I might be able to

- upload the group icon
- get the `uploaded_logo_id` for the uploaded icon

Thanks.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [03.Май.2017 08:50:39 UTC](https://meta.discourse.org/t/importer-how-to-upload-category-logo-images/62003/2 "2017-05-03T08:50:39Z")

</div>

> [@pfaffman](#):
>
> Can someone point me to where I might be able to
> 
> - upload the group icon
> - get the `uploaded_logo_id` for the uploaded icon

You need to create an `Upload` with your image and then use its id as the `uploaded_logo_id`.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [03.Май.2017 13:42:15 UTC](https://meta.discourse.org/t/importer-how-to-upload-category-logo-images/62003/3 "2017-05-03T13:42:15Z")

</div>

> <https://github.com/discourse/discourse/blob/main/app/jobs/regular/pull_hotlinked_images.rb#L38-L44>

These lines may help you. Here `src` is an external URL. It is downloading image from URL and creating new `Upload` model record. From this you can get `upload.id` to use in `uploaded_logo_id`.
