Support the ongoing development of Laravel.io →
posted 9 years ago
Input Forms
Last updated 2 years ago.
0

your ajax url should be relative to the root : change url:'add-catagory', to url:'/add-catagory',

try using Request class;

public function catadd($request){
    if ($request->hasFile('photo')) {
        //
    }
}
0

i could be wrong but doesnt your ajax request supposed to be of a different type other than post for file uploads? probably not...

0

try this....http://jquery.malsup.com/form/

0

If you want multiple Image Upload with preview then this link can help you : https://hdtuto.com/article/laravel-5-ajax-multiple-image-upload-with-preview-example

0

As long as your route and controller are concerned, they are configured right (check your code from this tutorial of laravel file and image upload). So the problem might be with AJAX configuration. Check your AJAX/jQuery file.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jishadp jishadp Joined 31 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.