Duplicate filename allowed when upload files using S3 storage #38

Open
opened 2026-04-05 16:21:17 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @arthanson on 3/31/2026

NetBox Edition

NetBox Community

NetBox Version

v4.5.5

Python Version

3.12

Steps to Reproduce

  1. switch to using S3 storage for image upload
  2. go to site and add an image attachment for a given file and choose "Create and Add Another"
  3. upload the same file again.
  4. check the uploaded image filenames in both image attachment and in Object Change

Expected Behavior

The images should have different filenames, when you do this using local file storage a unique value will be appended onto the filename to make it unique, for example:

site_28_action-buttons.png
site_28_action-buttons_sdmmer4.png

While having these names be the same causes no problem in the UI, the Object Change having the same name will cause issues with branching and is different behavior then when using local storage.

Observed Behavior

The file is uploaded in both places with the same name. Here is the object change records for both files:

name: ""
image: "image-attachments/site_28_action-buttons.png"
object_id: 28
description: ""
image_width: 1698
object_type: 57
image_height: 342
name: ""
image: "image-attachments/site_28_action-buttons.png"
object_id: 28
description: ""
image_width: 1698
object_type: 57
image_height: 342

as can be seen they are duplicated. On local file storage the second image will be:

name: ""
image: "image-attachments/site_28_action-buttons_sdmmer4.png"
object_id: 28
description: ""
image_width: 1698
object_type: 57
image_height: 342
*Originally created by @arthanson on 3/31/2026* ### NetBox Edition NetBox Community ### NetBox Version v4.5.5 ### Python Version 3.12 ### Steps to Reproduce 1. switch to using S3 storage for image upload 2. go to site and add an image attachment for a given file and choose "Create and Add Another" 3. upload the same file again. 4. check the uploaded image filenames in both image attachment and in Object Change ### Expected Behavior The images should have different filenames, when you do this using local file storage a unique value will be appended onto the filename to make it unique, for example: site_28_action-buttons.png site_28_action-buttons_sdmmer4.png While having these names be the same causes no problem in the UI, the Object Change having the same name will cause issues with branching and is different behavior then when using local storage. ### Observed Behavior The file is uploaded in both places with the same name. Here is the object change records for both files: ``` name: "" image: "image-attachments/site_28_action-buttons.png" object_id: 28 description: "" image_width: 1698 object_type: 57 image_height: 342 ``` ``` name: "" image: "image-attachments/site_28_action-buttons.png" object_id: 28 description: "" image_width: 1698 object_type: 57 image_height: 342 ``` as can be seen they are duplicated. On local file storage the second image will be: ``` name: "" image: "image-attachments/site_28_action-buttons_sdmmer4.png" object_id: 28 description: "" image_width: 1698 object_type: 57 image_height: 342 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#38