Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

codeigniter file upload - optional?

Tags:

People also ask

How to set upload file path in CodeIgniter?

Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you built above you set the following preferences: $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png';

How to set max file upload size in CodeIgniter?

if you want to set bigger upload size to your system, you need to go to php. ini file and change this. upload_max_filesize = 2M; //change this to your desired size.

How to upload pdf file in CodeIgniter?

For Uploading files, as usually we need a Simple HTML form, with an input field and submit button. Here is the Code: 'file','name' => 'userfile')); echo form_submit('submit','upload'); echo form_close(); ?>


I'm sure this is simple but I can't see how to make uploading a file with CI optional.

If you leave the file input box empty, the error "You didn't choose an upload file" appears.

The reason I want it to be optional is that my form edits a directory type listing, and I don't need to upload the image each time I edit the listing.

Is there a way to remove the "required" error handling on the file class