6

I was wondering how could we add attributes to file_upload in codeigniter

right now I am using form_open_multipart('controller');

but I want to add an id attribute to it.

Any help appreciated thanks!

Saty
  • 22,443
  • 7
  • 33
  • 51
koool
  • 15,157
  • 11
  • 45
  • 60

1 Answers1

21

From the User Guide:

form_open_multipart()

This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, which is necessary if you would like to use the form to upload files with.

So, you would use it in the same way you use form_open(). Example:

form_open_multipart('controller', 'id="my_id"');

Or:

form_open_multipart('controller', array('id' => 'my_id'));
Wesley Murch
  • 101,186
  • 37
  • 194
  • 228