Upload images in the form

Asked

Viewed 99 times

0

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

  • 1

    Could you add your form? And what have you tried so far?

1 answer

0

Simple as death, you will need two fields of the kind $_FILE, ex:

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

In your controller, you will treat each, ex:

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

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

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

From what I understand it’s this.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.