Enhance ImageAttachment model to allow uploading multiple images to NetBox models #8176

Closed
opened 2025-12-29 20:33:28 +01:00 by adam · 9 comments
Owner

Originally created by @F3d0s on GitHub (Jun 8, 2023).

NetBox version

v3.4.4

Feature type

New functionality

Proposed functionality

I'd like to propose adding the ability to attach multiple images to the ImageAttachment model, allowing users to upload and manage multiple images in a single action. Currently, users can only attach one image at a time, which can be slow and cumbersome when dealing with something that requires multiple images for documentation purposes (i.e. a device or a location).

This should be possible by:

  1. Modify the ImageAttachment model to include a new field, images, which will store the uploaded images.
  2. Enhance the user interface to provide a bulk upload functionality for adding multiple images.
  3. Update the API endpoints to support the bulk upload of images.
  4. Implement appropriate validation and error handling to ensure the integrity of the uploaded images.

Use case

This functionality would greatly benefit NetBox users, particularly those who heavily rely on visual documentation for their devices and locations. With the ability to attach multiple images, users can conveniently upload and manage all relevant images in one go, significantly reducing the time and effort required to document devices.

By implementing this feature, Netbox can offer a more robust and user-friendly experience, empowering users to manage and document their devices with greater flexibility efficiently.

Database changes

No response

External dependencies

No response

Originally created by @F3d0s on GitHub (Jun 8, 2023). ### NetBox version v3.4.4 ### Feature type New functionality ### Proposed functionality I'd like to propose adding the ability to attach multiple images to the ImageAttachment model, allowing users to upload and manage multiple images in a single action. Currently, users can only attach one image at a time, which can be slow and cumbersome when dealing with something that requires multiple images for documentation purposes (i.e. a device or a location). This should be possible by: 1. Modify the ImageAttachment model to include a new field, images, which will store the uploaded images. 2. Enhance the user interface to provide a bulk upload functionality for adding multiple images. 3. Update the API endpoints to support the bulk upload of images. 4. Implement appropriate validation and error handling to ensure the integrity of the uploaded images. ### Use case This functionality would greatly benefit NetBox users, particularly those who heavily rely on visual documentation for their devices and locations. With the ability to attach multiple images, users can conveniently upload and manage all relevant images in one go, significantly reducing the time and effort required to document devices. By implementing this feature, Netbox can offer a more robust and user-friendly experience, empowering users to manage and document their devices with greater flexibility efficiently. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurepending closurestatus: revisions needed labels 2025-12-29 20:33:28 +01:00
adam closed this issue 2025-12-29 20:33:28 +01:00
Author
Owner

@abhi1693 commented on GitHub (Jun 8, 2023):

Any reason this can't be done using device types? It provides images to be uploaded. Your proposal also somewhat lacks details about how this bulk update feature should be implemented. You have also asked to add a new field in your proposal and yet you have mentioned no database changes are required.
Your use case also does not justify the change you have proposed.

@abhi1693 commented on GitHub (Jun 8, 2023): Any reason this can't be done using device types? It provides images to be uploaded. Your proposal also somewhat lacks details about how this bulk update feature should be implemented. You have also asked to add a new field in your proposal and yet you have mentioned no database changes are required. Your use case also does not justify the change you have proposed.
Author
Owner

@ThomasADavis commented on GitHub (Jun 9, 2023):

See https://github.com/Kani999/netbox-attachments - does more than just devices.

@ThomasADavis commented on GitHub (Jun 9, 2023): See https://github.com/Kani999/netbox-attachments - does more than just devices.
Author
Owner

@F3d0s commented on GitHub (Jun 9, 2023):

Any reason this can't be done using device types? It provides images to be uploaded.

Maybe I'm missing something, but I don't see how can I add several images to a specific device from Device Types.

This is where I'd like to select more the one image and add it to a device or location. Now it can be done by selecting a single image file each time, but it will take a lot of time when someone needs to add many image files.

1

2

3

Your proposal also somewhat lacks details about how this bulk update feature should be implemented. You have also asked to add a new field in your proposal and yet you have mentioned no database changes are required. Your use case also does not justify the change you have proposed.

I agree that adding a new field won't be necessary, I am sorry, but I'm not familiar enough with the schema to know if any changes are necessary, and maybe I should keep the request simple. On the surface, it appears like it would be a simple addition. However, I think that the ability to bulk upload images will be appreciated by many admin users; imagine having to add 20 images to a single device or location, and you can do it in a few clicks instead of repeating the process for every single image.

@F3d0s commented on GitHub (Jun 9, 2023): > Any reason this can't be done using device types? It provides images to be uploaded. Maybe I'm missing something, but I don't see how can I add several images to a specific device from `Device Types`. This is where I'd like to select more the one image and add it to a device or location. Now it can be done by selecting a single image file each time, but it will take a lot of time when someone needs to add many image files. ![1](https://i.imgur.com/opjYPie.png) ![2](https://i.imgur.com/avMcpRa.png) ![3](https://i.imgur.com/zpDzWwZ.png) > Your proposal also somewhat lacks details about how this bulk update feature should be implemented. You have also asked to add a new field in your proposal and yet you have mentioned no database changes are required. Your use case also does not justify the change you have proposed. I agree that adding a new field won't be necessary, I am sorry, but I'm not familiar enough with the schema to know if any changes are necessary, and maybe I should keep the request simple. On the surface, it appears like it would be a simple addition. However, I think that the ability to bulk upload images will be appreciated by many admin users; imagine having to add 20 images to a single device or location, and you can do it in a few clicks instead of repeating the process for every single image.
Author
Owner

@jeremystretch commented on GitHub (Jun 14, 2023):

Your proposal appears to be written for devices and locations specifically but these models make use of the same ImageAttachment model that many other NetBox models also use for the same purpose. Is your intent to support bulk image attachments more generally? If so, please edit your initial post above to reflect that.

@jeremystretch commented on GitHub (Jun 14, 2023): Your proposal appears to be written for devices and locations specifically but these models make use of the same ImageAttachment model that many other NetBox models also use for the same purpose. Is your intent to support bulk image attachments more generally? If so, please edit your initial post above to reflect that.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 13, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Sep 13, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@F3d0s commented on GitHub (Sep 15, 2023):

Is your intent to support bulk image attachments more generally?

Yes, this would benefit the way to upload the images on netbox, as I think that now the procedure is rather slow and cumbersome.

@F3d0s commented on GitHub (Sep 15, 2023): > Is your intent to support bulk image attachments more generally? Yes, this would benefit the way to upload the images on netbox, as I think that now the procedure is rather slow and cumbersome.
Author
Owner

@jeremystretch commented on GitHub (Sep 15, 2023):

@F3d0s please edit your original post and title to reflect this.

@jeremystretch commented on GitHub (Sep 15, 2023): @F3d0s please edit your original post and title to reflect this.
Author
Owner

@F3d0s commented on GitHub (Sep 15, 2023):

@jeremystretch I hope it's correct now.

@F3d0s commented on GitHub (Sep 15, 2023): @jeremystretch I hope it's correct now.
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2023):

Modify the ImageAttachment model to include a new field, images, which will store the uploaded images.

This is not a viable proposal, nor would it be necessary. Each image attachment represents a single image and its corresponding file on disk. What you're asking for is a way to upload multiple image attachments in a more efficient manner; it's a workflow concern rather than a data model change. @F3d0s please either rewrite your proposal above or (preferably) close this out and create a new FR proposing your desired workflow changes.

@jeremystretch commented on GitHub (Oct 6, 2023): > Modify the ImageAttachment model to include a new field, images, which will store the uploaded images. This is not a viable proposal, nor would it be necessary. Each image attachment represents a single image and its corresponding file on disk. What you're asking for is a way to upload multiple image attachments in a more efficient manner; it's a workflow concern rather than a data model change. @F3d0s please either rewrite your proposal above or (preferably) close this out and create a new FR proposing your desired workflow changes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8176