how to make a upload form?

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
blackstrip
Posts: 16
Joined: Tue Sep 10, 2013 10:45 pm

how to make a upload form?

#1 Post by blackstrip » Sat Jun 20, 2015 8:36 am

Hi guys,

i want to make upload function to my plugins, the function is upload a config.cfg as router configuration to my server.
i already make a tab in settings page, and i know the form is an array.
how to using 'method' to make a upload button?

like this:

Code: Select all

$temp = array(
		'upload_header' => array(
			'friendly_name' => 'Upload Configuration',
			'method' => 'spacer',
			),
		'upload_button' => array(
			'friendly_name' => 'Upload config file',
			'description' => 'Upload config file',
			'method' => '????upload????',
			),
	);

cigamit
Developer
Posts: 2782
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: how to make a upload form?

#2 Post by cigamit » Sat Jun 20, 2015 6:15 pm

You can look at examples in include/global_form.php
'import_file' => array(
'friendly_name' => 'Import Template from Local File',
'description' => 'If the XML file containing template data is located on your local machine, select it here.',
'method' => 'file'
),

User avatar
blackstrip
Posts: 16
Joined: Tue Sep 10, 2013 10:45 pm

Re: how to make a upload form?

#3 Post by blackstrip » Sun Jun 21, 2015 10:33 am

cigamit wrote:You can look at examples in include/global_form.php
'import_file' => array(
'friendly_name' => 'Import Template from Local File',
'description' => 'If the XML file containing template data is located on your local machine, select it here.',
'method' => 'file'
),
hi cigamit, thank you so mush, work fine.

Post Reply