Welcome Guest, Not a member yet? Register   Sign In
Validate file if a select is...
#2

(This post was last modified: 03-17-2021, 02:18 AM by iRedds.)

If you upload a file, then information about it is in a separate array.
Use a request instance instead of $data.

PHP Code:
$file Config\Services::request()->getFile('field_name');

if (
$file !== null && $file->valid()) { // file uploaded without errors 
  // ....



https://codeigniter.com/user_guide/libra...files.html
Reply


Messages In This Thread
Validate file if a select is... - by pippuccio76 - 03-16-2021, 01:06 PM
RE: Validate file if a select is... - by iRedds - 03-17-2021, 02:16 AM
RE: Validate file if a select is... - by kenjis - 03-17-2021, 05:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB