Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ================Ini route==================
- Route::post('/post-product-catalog/upload','PengajuanProdukController@upload');
- ===============Ini controller laravel==============
- public function upload(Request $request)
- {
- $data = $request->all();
- Log::debug($data);
- return response()->json([
- "status" => "OK",
- "upload" => $data,
- ]);
- }
- ================Ini controller js==================
- $scope.upload = function ()
- {
- $("form#uploadImage").submit(function(event){
- event.preventDefault();
- var formData = new FormData($(this)[0]);
- $.ajax({
- url: '/supplier/post-product-catalog/upload',
- type: 'POST',
- data: formData,
- async: false,
- cache: false,
- contentType: false,
- processData: false,
- success: function (response) {
- }
- });
- return false;
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement