According to the docs, it seems the following file extraction should work:
<?php use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; Route::get('/', function (Request $request) { if ($request->hasFile('source' )) { return ">> GOOD ! <<"; } if ($request->hasFile('input.json')) { return ">> GOOD ! <<"; } $x = count($_FILES); return "DD >> $x << DD"; }); This is similar (but not identical1) to this post:
$ curl.exe -X GET -F "[email protected]" http://127.0.0.1:8008/ DD >> 0 << DD EDIT: When I change the receiving code to Route::post(...) then I get:
$ curl.exe -X POST -F "[email protected]" http://127.0.0.1:8008/ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Page Expired</title> < ... omitted ... > 1 In my case $_FILES is also empty
$request->hasFile('source')here source should be the name of theinput type="file" name="source"field of your formsourcein the http request should fit