OPNsense Forum

English Forums => General Discussion => Topic started by: vivekmauli14 on September 28, 2023, 02:05:30 pm

Title: Upload a file in a custom created plugin
Post by: vivekmauli14 on September 28, 2023, 02:05:30 pm
I was trying to create a plugin with reference to the HelloWorld plugin from the official documentation, I need to upload a file from the UI. I have created my volt file and inside that I have my upload file form. I am not able to understand how I take that input file and store it in /tmp.
Please guide me on this, it would be so helpful if you could give me any references about the same.

Title: Re: Upload a file in a custom created plugin
Post by: cookiemonster on September 28, 2023, 04:41:05 pm
Not specific to plugins or development but to my knowledge there is no way to upload files to the appliance from the UI.
Needs to drop to a console and use commands like scp, etc.
There are ways to use winscp and that sort of clicky ways but IMO not worth the effort when a simple command will do it in a fraction of a second.
Title: Re: Upload a file in a custom created plugin
Post by: vivekmauli14 on September 30, 2023, 06:38:50 am
The plugin I am designing is for the purpose of taking a file as input from the user and extracting encrypted data from the file. Other scripts are just working fine but I am stuck in designing the input file handling mechanism.

Thanks!
Title: Re: Upload a file in a custom created plugin
Post by: cookiemonster on October 01, 2023, 09:09:15 pm
Ah. Sorry I misunderstood.
So you want to know how to get your plugin code to import data. Seems like a development question.
https://github.com/opnsense/docs/blob/master/source/development/howtos.rst
aka the dev docs seem to suggest the code can be php.