Adding export file configuration (.cfg) in renderer config download #8491

Closed
opened 2025-12-29 20:37:24 +01:00 by adam · 3 comments
Owner

Originally created by @hardroners on GitHub (Aug 22, 2023).

NetBox version

v3.5.4

Feature type

Data model extension

Proposed functionality

For network device, we need to export the render configuration in a configuration format (.cfg) instead text (.txt). We proposed a pop-up with two choices (Text Format and Configuration Format) like this :

render config

Use case

This functionnality can help any workers in network who needs configuration file (.cfg)

Database changes

No response

External dependencies

No response

Originally created by @hardroners on GitHub (Aug 22, 2023). ### NetBox version v3.5.4 ### Feature type Data model extension ### Proposed functionality For network device, we need to export the render configuration in a configuration format (**.cfg**) instead text (**.txt**). We proposed a pop-up with two choices (Text Format and Configuration Format) like this : ![render config](https://github.com/netbox-community/netbox/assets/66667081/6c892d09-211d-420d-b4f0-3464f8b69ca0) ### Use case This functionnality can help any workers in network who needs configuration file (**.cfg**) ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:37:24 +01:00
adam closed this issue 2025-12-29 20:37:24 +01:00
Author
Owner

@abhi1693 commented on GitHub (Aug 22, 2023):

Isn't CFG essentially a text file but with the extension of .cfg? You can save the file with whatever extension you want I think.

@abhi1693 commented on GitHub (Aug 22, 2023): Isn't CFG essentially a text file but with the extension of `.cfg`? You can save the file with whatever extension you want I think.
Author
Owner

@hardroners commented on GitHub (Aug 22, 2023):

Yes it is but our workers don't have right to change extension in their laptop. They inject file in the device without any modifications.

@hardroners commented on GitHub (Aug 22, 2023): Yes it is but our workers don't have right to change extension in their laptop. They inject file in the device without any modifications.
Author
Owner

@jeremystretch commented on GitHub (Aug 22, 2023):

When you click the "download" button, NetBox returns the content of the rendered template with this HTTP header:

Content-Disposition: attachment; filename="devicename.txt"

This tells the browser it's intended to be saved as a local file with the suggested name. .txt was chosen as a reasonable default, but this can be modified by the user. This is standard behavior for all browsers. If your organization has some policy in place that disables this behavior, I'm afraid it's something you'll need to solve for locally.

We could add a file extension field to the ConfigTemplate model as we have for the ExportTemplate model: You're welcome to open a separate feature request for that if you believe there's sufficient justification to do so. But it would not be reasonable to hard-code arbitrary file suffixes into the UI.

@jeremystretch commented on GitHub (Aug 22, 2023): When you click the "download" button, NetBox returns the content of the rendered template with this HTTP header: ```Content-Disposition: attachment; filename="devicename.txt"``` This tells the browser it's intended to be saved as a local file with the suggested name. `.txt` was chosen as a reasonable default, but this can be modified by the user. This is standard behavior for all browsers. If your organization has some policy in place that disables this behavior, I'm afraid it's something you'll need to solve for locally. We _could_ add a file extension field to the ConfigTemplate model as we have for the ExportTemplate model: You're welcome to open a separate feature request for that if you believe there's sufficient justification to do so. But it would not be reasonable to hard-code arbitrary file suffixes into the UI.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8491