我正在实现'网络。gotev:uploadservice:4.5.1'将图像上载到我的服务器。我写了下面的代码,但没有配置获取异常消息通知,所以文件没有上传。当我尝试使用配置通知时 setNotificationConfig(new UploadNotificationConfig())
,它要求传入6个参数 New UploadNotificationConfig()
.
这是我的完整代码。
try {
String uploadId = UUID.randomUUID().toString();
//Creating a multi part request
new MultipartUploadRequest(this, upload_path)
.addFileToUpload(currentPhotoPath, "image") //Adding file
.addParameter("name", image_file_name) //Adding text parameter to the request
.setMaxRetries(2).setNotificationConfig(new UploadNotificationConfig())
.setUploadID(uploadId)
.startUpload(); //Starting the upload
} catch (Exception exc) {
Toast.makeText(this, exc.getMessage(), Toast.LENGTH_SHORT).show();
}
我尝试过,但未能成功地传递所需的参数并使该方法正常工作。有人能帮我修一下吗。
还附上图片解释所需的论点种类。我了解前2个,但对其他4个,不知道如何工作。
暂无答案!
目前还没有任何答案,快来回答吧!