How can I do something like :
.addMultipartFiles (String key, ArrayList) ;
But I didn't find such a way
Currently, the Fast-Android-Networking does not support uploading the images with the same key.
Can I add a request like this or how can I change it
------------------ 原始邮件 ------------------
发件人: "AMIT SHEKHAR"notifications@github.com;
发送时间: 2018年5月28日(星期一) 中午11:53
收件人: "amitshekhariitbhu/Fast-Android-Networking"Fast-Android-Networking@noreply.github.com;
抄送: "746608431"746608431@qq.com; "Author"author@noreply.github.com;
主题: Re: [amitshekhariitbhu/Fast-Android-Networking] How can I dosomething like : .addMultipartFiles (String key, ArrayList) ; (#290)
Currently, the Fast-Android-Networking does not support uploading the images with the same key.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Currently no support for that. We will add in upcoming release
Hi @everyline, I have added this support, please check the latest version 1.0.2
Thank you very much. I will try
Hi @amitshekhariitbhu , can you give one example how to upload multiple files at once?
There are many ways to do it.
If you have multiple files with different keys.
AndroidNetworking.upload(url)
.addMultipartFile("image1",file1)
.addMultipartFile("image2",file2)
.build()
.getAsString();
if you have multiple files with the same key.
AndroidNetworking.upload(url)
.addMultipartFileList("image",fileList)
.build()
.getAsString();
@invisionweb the above examples will help you.
if you have multiple files with the same key.
AndroidNetworking.upload(url) .addMultipartFileList("image",fileList) .build() .getAsString();
doing this only 1 file is sent to the server. e.g.
Files: Array
(
[photo] => Array
(
[name] => JPEG_924650411_1542817909683.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpQX4jGq
[error] => 0
[size] => 34975
)
)
I would expect even a single file to be passed back as an array??
Files: Array
(
[photo] => Array
(
[name] => Array
(
[0] => file0.jpg
[7] => file7.jpg
[5] => file5.jpg
Most helpful comment
Hi @everyline, I have added this support, please check the latest version
1.0.2