我想将图像和多字符串传递给服务器。
用于将图像发送到服务器,我使用库“ net.gotev:uploadservice:2.1”
但是,因为我的角色是utf8,当保存在db中时,显示?
我该怎么办?
我在android中的代码:
new MultipartUploadRequest(this, uploadId, Constants.UPLOAD_URL)
.addFileToUpload(path, "image") //Adding file
.addParameter("name", strFileName)
.addParameter("iduser", iduser+"") //Adding text parameter to the request
.addParameter("madah",madah.getText().toString() )
.addParameter("phone",phone.getText().toString())
.addParameter("sokhanran",sokhanran.getText().toString())
.addParameter("startdate", startdate.getText().toString())
.addParameter("enddate",enddate.getText().toString())
.addParameter("descript", descriptin.getText().toString())
.addParameter("linkax", linkax)
.addParameter("address",address.getText().toString())
.setNotificationConfig(new UploadNotificationConfig())
.setMaxRetries(2)
.startUpload();
最佳答案
采用
.setMethod(“ POST”)
.setUtf8Charset()
.setMaxRetries(2)
.startUpload();