正在发送空< input type =" file">字段与Curl上PHP

问题描述:

欢迎大家。

这是一个问题:
我试图使用PHP和CURL将数据与文件发送到服务器。
服务器接受6张照片的数据。
如果在$ _FILES数组中有少于6个项目 - 这是一个错误。

Here is a problem I have: I'm trying to send data with files to server using PHP and CURL. Server accepts data with 6 photos. And if there are less than 6 items in $_FILES array - it`s an error.

所以如果我发送所有6张照片,一切都完美。
但是如果有更少的照片,那么值为空的照片到$ _POST数组。

So if I send all 6 photos, everything goes perfectly. But if there are less photos, than value with empty photo goes to $_POST array.

我读Curl文档,但不能找到这样的可能性。
如何使用CURL发送文件类型的空值?

I read Curl documentation but couldn`t find such possibility. How can it be done with CURL to send an empty value of File type?

它的工作原理:

curl  -F "file_1=@files.zip" -F "file_2=@/dev/null;filename=" -F "file_3=@/dev/null;filename="