I'm having some issues uploading a file using Zend Framework. I have created a form, listed below, and have passed the data input to my model where I am attempting to upload the file. IT seems only to get the file name however and fails to upload to my uploads directory.
Form
<?php
class Application_Form_Admin extends Zend_Form
{
public function init()
{
// Set the method for the display form to POST
$this->setMethod('post');
// set the data format
$this->setAttrib('enctype', 'multipart/form-data');
// Add the title
$this->addElement('file', 'ogimage', array(
'label' => 'Default App Image',
'required' => false
));
// Add the submit button
$this->addElement('submit', 'submit', array(
'ignore' => true,
'label' => 'Submit',
));
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array(
'ignore' => true,
));
}
}
Controller
<?php
class AdminController extends Zend_Controller_Action
{
/**
* #var The Admin Model
*
*
*/
protected $app = null;
/**
* init function.
*
* #access public
* #return void
*
*
*/
public function init()
{
// get the model
$this->app = new Application_Model_Admin();
}
/**
* indexAction function.
*
* #access public
* #return void
*
*
*/
public function indexAction()
{
// get a form
$request = $this->getRequest();
$form = new Application_Form_Admin();
// pre populate form
$form->populate((array) $this->app->configData());
// handle form submissions
if($this->getRequest()->isPost()) {
if($form->isValid($request->getPost())) {
// save the clips
$this->app->saveConfig($form);
// redirect
//$this->_redirect('/admin/clips');
}
}
// add the form to the view
$this->view->form = $form;
}
}
Model
class Application_Model_Admin
{
/**
* #var Bisna\Application\Container\DoctrineContainer
*/
protected $doctrine;
/**
* #var Doctrine\ORM\EntityManager
*/
protected $entityManager;
/**
* #var ZC\Entity\Repository\FacebookConfig
*/
protected $facebookConfig;
/**
* Constructor
*/
public function __construct(){
// get doctrine and the entity manager
$this->doctrine = Zend_Registry::get('doctrine');
$this->entityManager = $this->doctrine->getEntityManager();
// include the repository to get data
$this->facebookConfig = $this->entityManager->getRepository('\ZC\Entity\FacebookConfig');
}
/**
* saveConfig function.
*
* #access public
* #param mixed $form
* #return void
*/
public function saveConfig($form){
// get the entity
$config = new \ZC\Entity\FacebookConfig();
// get the values
$values = $form->getValues();
// upload the file
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->setDestination(APPLICATION_PATH . '/../uploads/');
try {
// upload received file(s)
$upload->receive();
} catch (Zend_File_Transfer_Exception $e) {
$e->getMessage();
}
// get some data about the file
$name = $upload->getFileName($values['ogimage']);
$upload->setOptions(array('useByteString' => false));
//$size = $upload->getFileSize($values['ogimage']);
//$mimeType = $upload->getMimeType($values['ogimage']);
print_r('<pre>');var_dump($name);print_r('</pre>');
//print_r('<pre>');var_dump($size);print_r('</pre>');
//print_r('<pre>');var_dump($mimeType);print_r('</pre>');
die;
// following lines are just for being sure that we got data
print "Name of uploaded file: $name
";
print "File Size: $size
";
print "File's Mime Type: $mimeType";
// New Code For Zend Framework :: Rename Uploaded File
$renameFile = 'file-' . uniqid() . '.jpg';
$fullFilePath = APPLICATION_PATH . '/../uploads/' . $renameFile;
// Rename uploaded file using Zend Framework
$filterFileRename = new Zend_Filter_File_Rename(array('target' => $fullFilePath, 'overwrite' => true));
$filterFileRename->filter($name);
// loop through the clips and add to object
foreach($values as $k => $column){
$config->__set($k, $column);
}
// save or update the clips object
if(empty($values['id'])){
$this->entityManager->persist($config);
} else {
$this->entityManager->merge($config);
}
// execute the query
$this->entityManager->flush();
// set the id
$form->getElement('id')->setValue($config->__get('id'));
}
}
The issue was that I was accessing the form data before the upload with the following line:
// get the values
$values = $form->getValues();
This is now placed after the upload in the model and the file data is accessed instead with the following:
$file = $upload->getFileInfo();
You have to move the file to where you want it. Here is a small snippet that I use in my code
if($form->isValid($request->getPost())) {
$uploadedFile = new Zend_File_Transfer_Adapter_Http();
$uploadedFile->setDestination(APPLICATION_PATH.'/../public_uploads/');
if($uploadedFile->receive()) {
//Code to process the file goes here
} else {
$errors = $uploadedFile->getErrors();
}
$this->app->saveConfig($form);
}
Hope this helps you get started.
to make this work you need to set setValueDisabled = true in your form element otherwise as soon as you call $form->getValues() it will upload the file to the system temp folder.
Currently you are calling $form->getValues() before you are even setting the destination so the file goes to the default (system temp).
Related
I'm getting this error when i try to register via google api
string(331) "Legacy People API has not been used in project ******* before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=******** then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
And when i go that url i'm receiving
Failed to load.
There was an error while loading /apis/api/legacypeople.googleapis.com/overview?project=******&dcccrf=1. Please try again.
My google.php code in /vendor/league/oauth2-google/src/Provider is
<?php
namespace League\OAuth2\Client\Provider;
use League\OAuth2\Client\Exception\HostedDomainException;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
use Psr\Http\Message\ResponseInterface;
class Google extends AbstractProvider
{
use BearerAuthorizationTrait;
const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id';
/**
* #var string If set, this will be sent to google as the "access_type" parameter.
* #link https://developers.google.com/accounts/docs/OAuth2WebServer#offline
*/
protected $accessType;
/**
* #var string If set, this will be sent to google as the "hd" parameter.
* #link https://developers.google.com/accounts/docs/OAuth2Login#hd-param
*/
protected $hostedDomain;
/**
* #var array Default fields to be requested from the user profile.
* #link https://developers.google.com/+/web/api/rest/latest/people
*/
protected $defaultUserFields = [
'id',
'name(familyName,givenName)',
'displayName',
'emails/value',
'image/url',
];
/**
* #var array Additional fields to be requested from the user profile.
* If set, these values will be included with the defaults.
*/
protected $userFields = [];
/**
* Use OpenID Connect endpoints for getting the user info/resource owner
* #var bool
*/
protected $useOidcMode = false;
public function getBaseAuthorizationUrl()
{
return 'https://accounts.google.com/o/oauth2/auth';
}
public function getBaseAccessTokenUrl(array $params)
{
return 'https://www.googleapis.com/oauth2/v4/token';
}
public function getResourceOwnerDetailsUrl(AccessToken $token)
{
if ($this->useOidcMode) {
// OIDC endpoints can be found https://accounts.google.com/.well-known/openid-configuration
return 'https://www.googleapis.com/oauth2/v3/userinfo';
}
// fields that are required based on other configuration options
$configurationUserFields = [];
if (isset($this->hostedDomain)) {
$configurationUserFields[] = 'domain';
}
$fields = array_merge($this->defaultUserFields, $this->userFields, $configurationUserFields);
return 'https://www.googleapis.com/plus/v1/people/me?' . http_build_query([
'fields' => implode(',', $fields),
'alt' => 'json',
]);
}
protected function getAuthorizationParameters(array $options)
{
$params = array_merge(
parent::getAuthorizationParameters($options),
array_filter([
'hd' => $this->hostedDomain,
'access_type' => $this->accessType,
// if the user is logged in with more than one account ask which one to use for the login!
'authuser' => '-1'
])
);
return $params;
}
protected function getDefaultScopes()
{
return [
'email',
'openid',
'profile',
];
}
protected function getScopeSeparator()
{
return ' ';
}
protected function checkResponse(ResponseInterface $response, $data)
{
if (!empty($data['error'])) {
$code = 0;
$error = $data['error'];
if (is_array($error)) {
$code = $error['code'];
$error = $error['message'];
}
throw new IdentityProviderException($error, $code, $data);
}
}
protected function createResourceOwner(array $response, AccessToken $token)
{
$user = new GoogleUser($response);
// Validate hosted domain incase the user edited the initial authorization code grant request
if ($this->hostedDomain === '*') {
if (empty($user->getHostedDomain())) {
throw HostedDomainException::notMatchingDomain($this->hostedDomain);
}
} elseif (!empty($this->hostedDomain) && $this->hostedDomain !== $user->getHostedDomain()) {
throw HostedDomainException::notMatchingDomain($this->hostedDomain);
}
return $user;
}
}
How to fix this issue?
Legacy People API has not been used in project ******* before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=********
As the error message states you have not enabled the people api in your project and as you have included email and profile and are trying to request profiled data about the user.
return 'https://www.googleapis.com/plus/v1/people/me?' . http_build_query([
'fields' => implode(',', $fields),
'alt' => 'json',
You need to enable the people api in our project before you can request data. Click the link and follow the instructions below.
Go to Google developer console click library on the left. Then search for the API you are looking to use and click enable button
Wait a couple of minutes then run your code again. Then you will be able to make requests to the people api.
return 'https://www.googleapis.com/plus/v1/people/me?' . http_build_query([
'fields' => implode(',', $fields),
'alt' => 'json',
Legacy endpoint:
I also recommend up update your endpoint to the new people.get endpoint
https://people.googleapis.com/v1/people/me
I created a function so a user can upload files for an article/finished project. These uploaded images will appear on the homepage of the website.
When I am trying to upload files to a specific folder in my development environment, it works. However if I try to upload files in the production enviroment, the files won't move to the destination folder. Is there anyone that had a similar problem/can help me out?
The code down below is the Entity called Artikel (Article in English) Afbeeldingen -> Images in English
/**
* #ORM\Entity(repositoryClass="App\Repository\ArtikelRepository")
*/
class Artikel
{
/**
* #ORM\Id()
* #ORM\GeneratedValue()
* #ORM\Column(type="integer")
*/
private $id;
/**
* #ORM\Column(type="array")
*/
private $afbeeldingen = [];
public function getAfbeeldingen()
{
return $this->afbeeldingen;
}
public function setAfbeeldingen(array $afbeeldingen): self
{
$this->afbeeldingen = $afbeeldingen;
return $this;
}
}
The code down below is the services.yaml file in which the upload directory is configured (images_directory)
parameters:
locale: 'en'
images_directory: '%kernel.project_dir%/www/uploads/artikelen'
The code down below is the Controller for the Artikel entity called ArtikelController (Article and ArticleController in English)
/**
* #Route("/admin/artikel/new", name="artikel_new", methods={"GET","POST"})
*/
public function new(Request $request): Response
{
$artikel = new Artikel();
$form = $this->createForm(ArtikelType::class, $artikel);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$articleImages = $form->get('afbeeldingen')->getData();
$images_directory = $this->getParameter('images_directory');
$afbeeldingen = array();
$teller = 0;
foreach ($articleImages as $articleImage) {
$originalFilename = pathinfo($articleImage->getClientOriginalName(), PATHINFO_FILENAME);
$filename = Urlizer::urlize($originalFilename) . '-' . uniqid() . '.' . $articleImage->guessExtension();
$afbeeldingen[$teller] = $filename;
$teller += 1;
try {
$articleImage->move($images_directory, $filename);
} catch (FileException $e) {
}
}
$artikel->setAfbeeldingen($afbeeldingen);
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($artikel);
$entityManager->flush();
$this->addFlash('success', 'Artikel is aangemaakt.');
return $this->redirectToRoute('artikel_index');
}
return $this->render('artikel/new.html.twig', [
'artikel' => $artikel,
'form' => $form->createView(),
]);
}
I would be glad if someone could help me out! Thanks in advance!
the "www" folder is outside of the "public" folder.
You cannot access any folder outside the public.
set the service.yaml like that and try again and double-check the file system permission.
'%kernel.project_dir%/public/uploads/artikelen'
Background
I'm having an odd issue with a simple line of code that I don't understand. I have an Action on a Controller that i'm using for LinkedIn auth. The first time the user hits the controller it redirects to the LinkedIn site for authentication, once the user authenticates linked in redirects back to the same controller with the auth code in the url as a param.
http://beta.consynki.com/authentication/network/linkedin?code=DQTdGfxIlbsU...
Controller
class AuthenticationController extends WebController {
public function actionNetwork($network){
$access_token = Yii::$app->request->get('code');
$network_connection = NetworkFactory::build($network);
$client = $network_connection->getClient();
if($access_token && !is_null($access_token)){
$headers = Yii::$app->response->headers;
$headers->set('Pragma', 'no-cache');
$headers->add('X-Access-Token', $access_token);
return $this->render('success');
}
return $this->redirect($client->getLoginUrl(),302)->send();
}
}
EDIT 1 - WebController
/**
* Class WebController
*
* Default controller for public web pages. This class pulls meta tags from a seporately stored file, and makes
* them available to the view.
*
* #package www\components
*/
class WebController extends Controller {
public $meta = [];
public function beforeAction($event) {
$controller = $this->id;
$action = $this->action->id;
$meta_file = Yii::getAlias('#www') . '/meta/' . $controller . '/' . $action . '.php';
if (file_exists($meta_file)) {
$this->meta = include($meta_file);
$this->setMetaTags($this->meta);
}
return parent::beforeAction($event);
}
/**
* Set the meta tags for a page
*
* #param string $type
* #param $tag
* #param $value
*/
public function registerMetaTag($type = 'name', $tag, $value) {
if (!is_null($value)) {
$this->view->registerMetaTag([
$type => $tag,
'content' => $value
]);
}
}
public function behaviors() {
return [
/**
* The particular campaign used.
*
* Example social_share, stay_connected_add
*/
'utm_campaign' => [
'class' => 'common\behavior\TrackingBehavior',
'queryParam' => 'utm_campaign',
'sessionParam' => 'utm_campaign',
],
/*
* The source of the referral, could be an add network, facebook, email or just a link on the Consynki site.
*
* example: google, facebook, citysearch, welcome_email
*/
'utm_source' => [
'class' => 'common\behavior\TrackingBehavior',
'queryParam' => 'utm_source',
'sessionParam' => 'utm_source',
],
];
}
protected function setMetaTags($meta) {
foreach ($meta AS $key => $value) {
if (is_array($value)) {
$this->view->registerMetaTag($value, $key);
}
}
}
}
Problem
When I try to get the code from the GET param Yii::$app->request->get('code'); I get a NULL value. On further inspection of the $_GET array var_dump($app->request->get() or var_dump($_GET); I see the key for the code variable has a $ "?code" in front of it. This is very odd.
array(3) { ["network"]=> string(8) "linkedin" ["?code"]=> string(115) "DQTdGfxIlbsU..." ["state"]=> string(32) "12121..." }
Research Notes
It looks like Yii2 modify's the $_GET value as it passes the url routing. Not sure if this is the issue. Have updated to the latest version of yii and it didn't fix the problem.
Question
Why would this happen? How can I fix it so that I can get the code value?
Set rules there like this:
'authentication/network/<network:\w+>/<code:\w+>' => 'authentication/network',
'authentication/network/<network:\w+>' => 'authentication/network',
Now in action set parameters like:
public function actionNetwork($network, $code = null)
Your previous $access_token is now $code.
I'm developing a Wordpress plugin, and updating it through Wordpress' SVN. When entering the function to call back function getLogoUrl, I get this error:
Fatal error: Class 'plugin' not found in
/customers/1/6/2/carpe-noctem.no/httpd.www/wp-content/plugins/logo-switcher/inc/helpers.php
on line 21
The issue is that the class doesn't exist at all, and that the file is long gone deleted. The code in that file has been moved to a different file, yet the error shows up for a file that has been deleted from the system.
This is the file that has the class that should be called back.
<?php
/*
* This file is part of the logo-switcher package.
* (c) Iversen - Carpe Noctem <info#carpe-noctem.no>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
// Block direct access
if(!defined('ABSPATH'))exit;
/**
* Logo Switcher
*
* #author Iversen - Carpe Noctem
*/
if (class_exists('class_Logo_Switcher')) {
class class_Logo_Switcher
{
/**
* Add Theme Customize Support
*
* #param WP_Customize_Manager $manager
*/
public static function addThemeCustomizeSupport(\WP_Customize_Manager $manager)
{
// add the image filed
$manager->add_setting('logo_switcher');
$manager->add_control(new \WP_Customize_Image_Control($manager, 'logo_switcher', array(
'label' => __('Choose your logo', 'logo-switcher')
, 'section' => 'title_tagline'
, 'description' => __('Note: Depending on the current theme setting, the choosen logo might be used on the login page.', 'logo-switcher')
)));
}
/**
* Add the logo to the login page
*
* Change the logo in the login page and also change the url href and title
*
* #return boolean false if the optioh is disabled
*/
public static function addLoginSupport()
{
$setting = self::getOptions();
if (!$setting['enable-on-login-page'])
return false;
add_filter('login_headerurl', function() {
return get_bloginfo('url');
});
add_filter('login_headertitle', function() {
return get_bloginfo('description');
});
$url = static::getLogoUrl();
if (!empty($url)) {
list($width, $height, $type, $attr) = getimagesize($url);
print(
'<style type="text/css">'
. ".login h1 a {background-image: url('{$url}'); background-size: 100%; width:100%; height:{$height}px;}</style>"
);
} else {
print(
'<style type="text/css">.login h1 a {display:none}</style>'
);
}
}
/**
* Get options
*
* #return array
*/
public static function getOptions()
{
$default = array(
// path for default logo image
'default' => '/logo.png',
//the logo url (default to home page)
'url' => home_url('/'),
// the logo desciption default to (get_bloginfo('name', 'display'))
'description' => get_bloginfo('name', 'display'),
// enable logo display on the login page
'enable-on-login-page' => true,
);
return apply_filters('logo-switcher.options', $default);
}
/**
* Get the logo url
*
* #return string
*/
public static function getLogoUrl()
{
$setting = self::getOptions();
($result = get_theme_mod('logo_switcher')) && !empty($result) ?
$result : $setting['default'];
return esc_url($result);
}
/**
* Print logo url
*
* #param string $path the url target
* #param string $description the logo image description
*
*/
public static function printLogo($path = null, $description = null)
{
$setting = static::getOptions();
$path = !empty($path) ? $path : $setting['url'];
$description = !empty($description) ? $description : $setting['description'];
echo sprintf(
'<img src="%3$s" alt="%2$s">'
, esc_url($path)
, esc_attr($description)
, esc_url(static::getLogoUrl())
);
}
}
}
$Logo_Switcher_Plugin = new class_Logo_Switcher;
Any help to get?
Use not class_exists()
if (!class_exists('class_Logo_Switcher')) {
class class_Logo_Switcher { }
}
I am using Ionic framework for mobile app development. The Yii2 API code below can be used for file upload, but it doesn't work. It shows the following errors:
i) Undefined offset: 0.
ii) yii\db\BaseActiveRecord->save()
public function actionNew() {
$model = new Apiprofile();
$userid = $_REQUEST['user_id'];
$photo = $_FILES['photo'];
$model->user_id = $userid;
$model->photo = $photo;
$name = $model->user_id;
$model->file = UploadedFile::getInstance($model, 'photo');
if($model->file) {
$model->file->saveAs('uploads/photos/'.$name.'.'.$model->file->extension);
$model->photo = $name.'.'.$model->file->extension;
$model->save();
}
$name = $model->user_id;
if($model->save()) {
echo json_encode(array('status'=>1,'data'=>$model->attributes),JSON_PRETTY_PRINT);
} else {
echo json_encode(array('status'=>0,'error_code'=>400,'errors'=>$model->errors),JSON_PRETTY_PRINT);
}
}
Hi if you want I will share my helper class that I used for working with images in Yii2 REST.
In the base folder of your application create folder components and inside of that folder create two folders helpers and objects.
-->assets
-->componests
----->helpers
----->objects
-->config
-->...
after that create class FileUpload inside of objects folder and put this code inside.
<?php
namespace app\components\objects;
class FileUpload
{
public $error=[];
public $isSuccess=false;
public $file;
public $ready_path;
public $file_type;
public $file_size;
public $file_extension;
public $file_tmp_name;
public $file_name;
public $save_path;
public function __construct($file,$save_path,$ready_path,$required=false)
{
if(!isset($_FILES[$file])){
if($required){
$this->error=['message'=>$file.' is required'];
}
return $this;
}
$this->save_path=$save_path;
$this->ready_path=$ready_path;
$this->file_type = strtolower($_FILES[$file]['type']);
$this->file_name = $_FILES[$file]['name'];
$this->file_tmp_name=$_FILES[$file]['tmp_name'];
$this->file_size = $_FILES[$file]['size'];
$this->file_extension=pathinfo($this->file_name, PATHINFO_EXTENSION);
}
public function setError($error){
if(empty($this->error)){
$this->error=$error;
}
}
}
Then inside of helpers folder create class FileUploadHelper and then put this code inside.
<?php
namespace app\components\helpers;
use app\components\objects\FileUpload;
use Yii;
class FileUploadHelper
{
private $allowed_files;
private $file_size;
const IMAGE='image';
const FILE='file';
/** File Upload
* #param string $file_name
* #param string $save_path
* #param string $ready_path
* #param string $type
* #param bool $required
* #return \app\components\objects\FileUpload
*/
public static function fileUpload($file_name,$save_path,$ready_path,$type,$required=false){
$image=new FileUpload($file_name,$save_path,$ready_path,$required);
if($type==self::FILE){
$allowed_files=Yii::$app->params['allowed_files'];
$file_size=Yii::$app->params['file_max_size'];
}else{
$allowed_files=Yii::$app->params['allowed_files'];
$file_size=Yii::$app->params['file_max_size'];
}
$dir = realpath(Yii::$app->basePath);
if(in_array($image->file_type,$allowed_files)
&&$image->file_size<$file_size){
$filename = $file_name.'_'.md5(uniqid(time()).time() . '_' . date('YmdHis')) . '.' . $image->file_extension;
$file = $dir . $image->save_path . $filename;
if(move_uploaded_file($image->file_tmp_name, $file)){
$image->file=$image->ready_path. $filename;
$image->isSuccess=true;
$image->setError(['message'=>'file_upload_success']);
}else{
$image->setError(['message'=>'error_try_again']);
}
}else{
$image->setError(['message'=>'file_should_be_no_more_than_given_size']);
}
return $image;
}
/** Delete File
* #param string $ready_file
*/
public static function deleteImage($ready_file){
$dir = realpath(Yii::$app->basePath);
if (strpos($ready_file, 'default') === false){
if(is_file($dir.'/web/'.$ready_file)){
unlink($dir.'/web/'.$ready_file);
}
}
}
}
That's all needed. Below I will give you example
public function actionEditAvatar($id)
{
$product = Product::findOne($id);
if( $product ){
$old_avatar=$product->avatar;
$image=FileUploadHelper::fileUpload(ProductForm::AVATAR,Yii::$app->params['product_path'],Yii::$app->params['product_ready_path'],FileUploadHelper::IMAGE);
if($image->isSuccess) {
$product->avatar = $image->file;
if($product->save()){
FileUploadHelper::deleteImage($old_avatar);
return $product->avatar;
}
}
return $image->error;
}
throw new NotFoundHttpException;
}
The code above from a real project. FileUploadHelper has two static classes which are "fileUpload" and "deleteImage".
FileUploadHelper requires fileUpload('file_name','save_path','ready_path','type')
'save_path' is where the file will be saved.
'ready_path' is how the ready URL should be like.
they are in Yii::$app->params[];
You can check if image succeeded or not by attribute isSuccess. If you have the error you can access them by attribute error. The ready file can be accessed by attribute file. You can delete image via static function deleteImage('saved_image_url'); All of them are used at above action. Please see it.
By the way, here the params that I used. Do not forget to to create folders inside web/uploads and change names of the folders like in config file.
return [
'adminEmail' => 'admin#example.com',
'allowed_images' => [ 'image/jpeg', 'image/gif', 'image/png' ],
'allowed_files' => [ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document','application/msword', 'application/pdf','image/jpeg', 'image/gif', 'image/png'],
'image_max_size' => 2097152,
'file_max_size' => 8388608,
'owner_document_path' => '/web/uploads/owner_document/',
'owner_document_ready_path' => 'uploads/owner_document/',
'product_path' => '/web/uploads/product/',
'product_ready_path' => 'uploads/product/',
'complain_photo_path' => '/web/uploads/complain_photo/',
'complain_photo_ready_path' => 'uploads/complain_photo/',
'owner_path' => '/web/uploads/owner/',
'owner_ready_path' => 'uploads/owner/',
'staff_path' => '/web/uploads/staff/',
'staff_ready_path' => 'uploads/staff/',
];