Level 36
@Raimondas - i'm not sure whether it'll work the way you're doing it.
For my part, i'm using this package: https://packagist.org/packages/dflydev/apache-mime-types
So I'm getting this when I want to submit my form:
Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)
I have enabled in php.ini - php_fileinfo extension. I also restarted my localhost server.
This is my rule: 'img_1' => 'required|mimes:png,gif,jpeg',
This is what I get when I submit form:
at MimeTypeGuesser->guess('C:\xampp\tmp\php2490.tmp') in File.php line 79
This is how I uploading image:
public function storeAuction(AuctionSubmitRequest $request)
{
$product = Product::create($request->all());
if(Input::hasfile('img_1'))
{
$request->file('img_1')->move(public_path('images'), $request->file('img_1')->getClientOriginalName());
$product->img_1 = 'images' . $request->file('img_1')->getClientOriginalName();
}
$product->user_id = Auth::user()->id;
$product->save();
return redirect('/');
}
@Raimondas - i'm not sure whether it'll work the way you're doing it.
For my part, i'm using this package: https://packagist.org/packages/dflydev/apache-mime-types
Please or to participate in this conversation.