This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

iillexial5598
iillexial5598

Hello. I want make jquery file upload with jquery.upload plugin. I need return json response in my controller in create method:

    public function create()
    {
        return \Response::make(['param'=>'value']);
    }

But it's not working in return me html page. How to make response? I don't user AJAXFramework, i use my script with jquery.upload plugin and send ajax request in /admin/zaweb/gallery/attachment/create

younesrafie
younesrafie

Have you tried to return only the array?

public function create()
{
        return ['param'=>'value'];
}
iillexial5598
iillexial5598

I return only array then i gat error: Array to string convertition I try json_encode, but get html page. can be set up to send requests and route will there?

Last updated

Daniel81
Daniel81

Is there a reason you can't use the built-in AJAX fileupload?

FrankWikstrom
FrankWikstrom

Shouldn't it be

return \Response::json(['param' => 'value']);

instead?

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.