I am using the following code to store the ParseObject with a ParseFile. I have enabled Parse local datastore in Application subclass. This code storing an instance of the P
I have solved this problem by simply storing the bytes of the file with ParseObject. When I want my file, I am writing those bytes back to a file.
My requirement was to store a audio recording file with name in the parse. I followed the these steps: 1. Get the byte array of file 2. Put the byte array into ParseObject 3. Call ParseObject#saveEventually()
Code:
File file = new File(filePath);
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
byte data[] = new byte[(int) file.length()];
fis.read(data);
ParseObject obj = new ParseObject("Recordings");
obj.put("name", name);
obj.put("data", data);
obj.saveEventually();
} catch (IOException e) {
e.printStackTrace();
}