I have a problem when trying to upload an image via bluimp's jQueryFileUpload.
In my routes i have this: Route::post('image/upload/{folder}', 'ImageController@upload');
my file input that is outside the
tags because it is independent to the form:my jQuery function points to the data-url attribute value.:
$('#imageupload').fileupload({
dataType: 'json',
maxFileSize: 5000000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
done: function (e, data) {
Members.handle_image(data);
}
});
The weird thing is that when i call this method from example.app/admin/members/create it works, but when i'm trying to access it from example.app/admin/members/1/edit i get a 405, Method not allowed.
In both cases, the Method is POST.
My routes for create and edit URIs:
Route::get('members/create', [
'uses' => 'MembersController@create', 'as' => 'admin/members/create'
]);
Route::get('members/{member}/edit', [
'uses' => 'MembersController@edit', 'as' => 'admin/members/edit'
]);
I'm sure is something really stupid that i can't see.
PS. I have a Project resource, where i also upload images, using the same route and function. It works on both cases (create and edit).
Anybody had this problem ?
Thank you!