Uploading images in the form

0

I have a form that needs to upload two images in the same form and that should be posted in different folders, does anyone have any tips ?? Thanks

    
asked by anonymous 02.04.2015 / 15:56

1 answer

0

Simple as death, you will need two fields of type $_FILE , eg:

<input type="file" name="file1" />
<input type="file" name="file2" />

In your controller, you will treat each one, eg:

$file1 = Request::file('file1');
$file2 = Request::file('file2');

if ($file1)
{
  $file1->move($diretorio, $file1);
}

if ($file2)
{
  $file2->move($diretorio, $file2);
}

So I understand that.

    
02.04.2015 / 16:24