将多个图像上传到parse.com在线数据库

时间:2022-02-16 15:50:20

I am having a problem with Parse.com online database . In my app I need to upload multiple images to the Parse.com database.At this moment I am able to upload single image to parsefile and save it to parse object.Please suggest some answers.

我在使用Parse.com在线数据库时遇到问题。在我的应用程序中,我需要将多个图像上传到Parse.com数据库。此时我可以将单个图像上传到parsefile并将其保存到解析对象。请提出一些答案。

1 个解决方案

#1


I didn't tried with images, but the saveAllInBackground worked for me. Although I'm having problems getting the objects Ids after the process complete.

我没有试过图像,但saveAllInBackground为我工作。虽然我在进程完成后获取对象ID时遇到问题。

Try this:

ParseObject.saveAllInBackground(objectsToUpload, new SaveCallback() {
                        @Override
                        public void done(ParseException e) {
                            if ( e == null )
                            {
                                //success

                                }
                            } else {
                                //error
                            }
                        }
                    });

It's worth mentioning that the objectsToUpload is an ArrayList of ParseObjects. As I said the operation worked, but I couldn't manage to get the objectsId from the objects uploaded

值得一提的是objectsToUpload是ParseObjects的ArrayList。正如我所说,该操作有效,但我无法从上传的对象中获取objectsId

#1


I didn't tried with images, but the saveAllInBackground worked for me. Although I'm having problems getting the objects Ids after the process complete.

我没有试过图像,但saveAllInBackground为我工作。虽然我在进程完成后获取对象ID时遇到问题。

Try this:

ParseObject.saveAllInBackground(objectsToUpload, new SaveCallback() {
                        @Override
                        public void done(ParseException e) {
                            if ( e == null )
                            {
                                //success

                                }
                            } else {
                                //error
                            }
                        }
                    });

It's worth mentioning that the objectsToUpload is an ArrayList of ParseObjects. As I said the operation worked, but I couldn't manage to get the objectsId from the objects uploaded

值得一提的是objectsToUpload是ParseObjects的ArrayList。正如我所说,该操作有效,但我无法从上传的对象中获取objectsId