Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test if file upload is supported on server using php

This is my code to test for MySQL:

if (extension_loaded('mysqlnd')) {
   echo "mysql supported";
} else {
   echo "mysql not supported";
};

How can I check to see if uploads are allowed?

like image 701
Kichu Avatar asked Dec 28 '11 10:12

Kichu


1 Answers

if(ini_get('file_uploads') == 1)
{
  echo 'HTTP Upload Enabled';
}
else
{
  echo 'HTTP Upload Disabled';
}
like image 178
Zul Avatar answered Nov 14 '22 20:11

Zul