小编Ela*_*lau的帖子

如何将音频文件上传到Parse.com - Android

我有一个文件路径,我想上传到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)

audio upload android file parse-platform

3
推荐指数
1
解决办法
1096
查看次数

标签 统计

android ×1

audio ×1

file ×1

parse-platform ×1

upload ×1