简体   繁体   English

android中没有图像文件的分段上传

[英]Multipart upload without image file in android

Ok this is my doing ,Currently I'm working on class file ,the situation is explained below, 好的,这是我的工作,当前我正在处理类文件,情况说明如下,

1) I usually collect input from 6 or 7 EditText 1)我通常从6或7个EditText收集输入

2)There will be three buttons to choose three files ,it is not compulsory to choose all 3 files ,he may choose 1,2 or 3 ,it is also not compulsory to choose even 1 image.. 2)将有三个按钮来选择三个文件,不是必须全部选择三个文件,他可以选择1,2或3,甚至也不必选择一个图像。

the problem is here ,, 问题在这里

what i did was using for loop to iterate through images ,and for each loop i upload image along with collected inputs from editext 我所做的是使用for循环遍历图像,对于每个循环,我都会上载图像以及来自editext的输入

as i said earlier it is not compulsory to upload image,,how can i use same code to send inputs from edittext without images,,,, 正如我之前说的,上传图片不是强制性的,我如何使用相同的代码从没有文本的edittext发送输入,

假设如果您正在使用Multipart并尝试使用相同的服务发送带有和不带有Image的内容,则无法发送,因为Multipart无法接受空值。因此,更好的选择是使用两个单独的服务来发送图像,方法是多部分和其他没有多部分的,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM