我无法在imageview中上传图片,这是从手机图库到parse.com数据库。 Parse说文件限制是10MB。谁能告诉我我做错了什么?
ParseFile imgFile = new ParseFile(fullName+"_"+emp+".jpeg", bite_image);
imgFile.saveInBackground();
ParseObject teamTable = new ParseObject("TeamsTable");
teamTable.put("Team", team);
teamTable.put("Name", fullName);
teamTable.put("images", imgFile);
teamTable.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
startActivity(new Intent(RegisterForm.this, Login.class));
Toast.makeText(getApplicationContext(), "Successful Registration!", Toast.LENGTH_LONG).show();
finish();
} else {
}
}
});
答案 0 :(得分:0)
首先应保存包含图像的PFFile,然后将此PFFile添加到对象中。
PFFile *file = [PFFile fileWithName:@"image.jpg" data:UIImageJPEGRepresentation(image,1.)];
[file saveInBackgroundWithBlock:^(BOOL succeeded, NSError * _Nullable error) {
if (succeeded) {
// Add the file to your object and save your object