directus-php-sdk
directus-php-sdk copied to clipboard
Multiple files in request body
Hello! Thank you guys for your work, amazing solution, but I found an issue. Directus.php on line 148 has issues with $_FILES.
When I tried to get files from frontend request body I've got an error:
$_FILES["file"]
can't read with "file" key if I've sent form data where key is "files".
Changing form data files key to "file" of course will not change the situation because it will try to read $_FILES["file"]['tmp_name']
where 'tmp_name' is not a string but array with temp names of each file.
The only one way I can upload files right now is by sending each one in separate request.
apart from that, the files_create()
only works with the filename file
. Many Array offsets are using $data["file"]["name"]
Hi @ShadXst,
I will have a look at this for my next release which I hope will be a big one. Not had a chance to work on this for a while but hopefully will be able to shortly.
Hi, can have a example please ? I have the same problem