0zeroinfection0's avatar

Restricting file upload size and type

Hello I was wondering if someone could point me in the right direction to restrict file type upload. I have everything setup in controller ok and upload works just can't seem to restrict what file type they can upload. Thanks

0 likes
3 replies
0zeroinfection0's avatar

Tried but no luck, must be doing something wrong...

    // THIS INPUT RETURN FROM CREATE PAGE POST //
    $Post->author_id = Auth::id();
    $Post->category_id = $request->input('category_id');
    $Post->title = $request->input('title');
    $Post->body = $request->input('body');
    $Post->slug = $request->input('title');
    $Post->vedio = $request->input('vedio');
    // THIS FUNCTION CREATE NEW IMAGE POST IN PAGE POSTS CREATE //
     if ($request->file('image')){
      $file = $request->file('image' => 'mimes:jpg,bmp,png');
      // THIS FUNCTION TO GET DATE NAME FILE //

Please or to participate in this conversation.