Laravel 5.1 - 文件上传错误(ERR_CONNECTION_RESET)

My application accesses two firebird db: one for data and one for files. When do I upload a file, it is written correctly on the bench, but the page is slow to load and then displays the error.I have done using Ajax and noticed that the file is written two times in the db. The first shows no mistake; in the second case the error. The strange thing is that I do not have any loop for this. Picked up the file using:

file_get_contents($file_tmp); 

and to connect to the image db:

DB::connection('firebird2')->insert($sql, $args);

PS.: This only occurs when I try to send the file contents to the database. When sending only the description, the error does not happen.

Thank you very much in advance.