Abhi324's avatar

Forms - using files & image upload without form class

Hi ,

i was just wondering if its possible to use normal form syntax rather than laravel form class for image upload .

e.g :

{!! Form::open(array('url'=>'apply/upload','method'=>'POST', 'files'=>true)) !!}

Instead of the above i use :

< form class="form-horizontal" role="form" name="x-update" method="POST"  action="{{ url('/update-x') }}" >

adding files="true" in the above does not seem to work and i can;t find the correct syntax in the docs.

same thing for :

{!! Form::file('image') !!}

I was just wondering if i had to use laravel form class for the above function or is there the equivalent syntax for normal html forms.

Thanks

0 likes
3 replies
Snapey's avatar

Yes of course. The Form class is just helpers (like macros). just use regular fields

thefuzzy0ne's avatar

You'll need to make sure you add the right attribute to your form:

<form ... enctype="multipart/form-data">

Now you can upload files. :)

Please or to participate in this conversation.