Jqgrid上传文件示例

I have a jqgrid and I'd like to upload a file, I got the following code

 colModel: [
    { name: "id", index:"id", key: true,width: 30,editable: false },

    { name: "name", index:"name", width: 100,editable: true },           
    { name: "fileToUpload", 
      editoptions: {
          enctype: "multipart/form-data"
        }, 
        edittype:'file',
        index: 'fileToUpload', 
        width: 150,
        align: "left",
        editable: true },
], 

and I use the function like in jqgrid - upload a file in add/edit dialog

My problem is that I don't know how to use the url file of the ajaxfileupload function to save this file in a database , Can anyone show me an example??

Thanks!

This is my working example:

colModel: 
[
    {
        name: 'photo1',
        label: 'Фото1',
        index: 'photo1',
        search: false,
        editable: true,
        edittype: 'file',
        editoptions: {
            enctype: "multipart/form-data"
        },
        align: 'center',
    },
],

Then - I have used callback:

afterSubmitCell: function (serverResponse, rowId, cellName, value, iRow, iCol) {
    var fileCell = (+rowId + 1) + '_' + cellName;
    var grid = $("#reports");

    var fileContainer = document.getElementById(fileCell).files;
    if (fileContainer !== null) {
        if (fileContainer.length > 0) {
            var file = fileContainer[0];
            var form = new FormData();
            form.append(cellName, file);
            form.append('id', rowId);

            $.ajax({
                url: "/api/reports/save-file",
                type: 'POST',
                data: form,
                processData: false,
                contentType: false,
                success: function (data) {
                    grid.jqGrid('setGridParam', {datatype: 'json'})
                            .trigger('reloadGrid', [{page: 1}]);
                }
            });
        }
    }

    return [true, serverResponse]
},

And then save file on my backend-part (Laravel):

if ($request->hasFile('photo1')) {
    $file = $request->file('photo1');
    if ($file->isValid()) {
        $fileName = rand(1000, 9999) . "." . $file->getClientOriginalExtension();

        //Put file on the server
        if (!empty($report)) {
            $report->attachFile($file, $fileName);
            $report->photo1 = $fileName;
            $response['status'] = $report->save();
        }
    }
}