I have an upload button to upload CV here
btnUploadResults.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
myFileIntent = new Intent(Intent.ACTION_GET_CONTENT);
myFileIntent.setType("*/*");
startActivityForResult(myFileIntent,30);
}
});
Then there is a code to upload that CV to backendless below
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
switch (requestCode){
case 10:
if(resultCode== RESULT_OK){
String path = data.getData().getPath();
//Toast.makeText(this, "path : " + path, Toast.LENGTH_SHORT).show();
String serverPath = "https://backendlessappcontent.com/8E3F66A3-828B-5C65-FF7F-E70047E63700/8FFDA82D-FE6B-FFDB-FF1C-41BA8ADDD400/files/Users+CV";
Backendless.Files.upload(new File(path), serverPath, true, new AsyncCallback<BackendlessFile>() {
@Override
public void handleResponse(BackendlessFile response) {
Toast.makeText(StudentRegistration.this, "PDF SAVED TO SERVER", Toast.LENGTH_SHORT).show();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(StudentRegistration.this, fault.getMessage(), Toast.LENGTH_SHORT).show();
}
}
);
}
break;
What am I doing wrong because the CV cannot be saved??