Created
February 12, 2016 07:34
-
-
Save ishaan1995/16942130abe71f08c96d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ParseFile file = new ParseFile(f); | |
file.saveInBackground(new SaveCallback() { | |
public void done(ParseException e) { | |
// Handle success or failure here .. | |
if (e == null) { | |
Toast.makeText(getApplicationContext(), "File Uploaded", Toast.LENGTH_SHORT).show(); | |
Log.d("ishaan","uploadede url: "+file.getUrl()); | |
} else { | |
Toast.makeText(getApplicationContext(), "Error: " + e.toString(), Toast.LENGTH_SHORT).show(); | |
Log.d("ishaan-parse", "" + e.getMessage()); | |
e.printStackTrace(); | |
Log.d("ishaan-parse",""+e.getCode()); | |
} | |
spinner.setVisibility(View.GONE); | |
} | |
}, new ProgressCallback() { | |
public void done(Integer percentDone) { | |
// Update your progress spinner here. percentDone will be between 0 and 100. | |
//spinner.incrementProgressBy(percentDone); | |
Log.d("perc", "Done:" + percentDone); | |
} | |
}); | |
ParseObject files = new ParseObject("Files"); | |
files.put("file_link", file); | |
//files.put("compr_data",compFile); | |
files.put("file_name",abc); | |
files.put("file_desc",desc); | |
files.saveInBackground(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment