我有一个文件路径,我想上传到Parse.com.
例如,其中一个文件路径是:"/ storage_emulated/0/app100/2015-06-04_00:45:16_RecordSound.3gp"
现在,我想将其上传到Parse.com.任何解决方案怎么做?
我试过为此编写一个方法,但它不起作用:
private ParseObject uploadAudioToParse(File audioFile, ParseObject po, String columnName){
if(audioFile != null){
Log.d("EB", "audioFile is not NULL: " + audioFile.toString());
ByteArrayOutputStream out = new ByteArrayOutputStream();
BufferedInputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(audioFile));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
int read;
byte[] buff = new byte[1024];
try {
while ((read = in.read(buff)) > 0)
{
out.write(buff, 0, read);
}
} catch (IOException e) {
e.printStackTrace();
}
try {
out.flush();
} catch (IOException …Run Code Online (Sandbox Code Playgroud)