0

My question is very similar to this post "storing multiple ParseFile objects in single ParseObject", but can't resolve it on my own

ParseObject pObject = new ParseObject();    
ArrayList<ParseFile> pFileList = new ArrayList<ParseFile>();
for (String thumbPath : thumbList) {
   byte[] imgData = convertFileToByteArray(thumbPath);
   ParseFile pFile = new ParseFile("mediaFiles",imgData);
   pFileList.add(pFile);    
}

   pObject.addAll("mediaFiles", pFileList); 
   pObject.saveEventually();

And Hector Ramos answered the question:Try uploading the ParseFiles using the save method before associating them with the Parse Object.

Can anyone tell me how to change this piece of code? appreciate any kindly help.

2
  • this is the error I got from android studio: java.lang.IllegalStateException: Unable to encode an unsaved ParseFile. Commented May 15, 2015 at 8:13
  • Problem solved, just added pFile.save() Commented May 15, 2015 at 18:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.