java - Drive Api Phone -
i'm trying create java program create , upload excel files google drive. after uploading need give permissions. have done thatbut problem lies in trying convert excel files google files in order people use sheets able update them phones. have not been able find on how on google api. appreciated.
assuming have path excel file:
java.io.file filecontent = new java.io.file(excelfilepath); filecontent mediacontent = new filecontent("application/vnd.ms-excel", filecontent); // file's metadata. file body = new file(); body.settitle(filecontent.getname()); body.setmimetype("application/vnd.ms-excel"); // important part insert request = service.files().insert(body, mediacontent); request.setconvert(true); file file = request.execute(); // end of important part if (file != null) { showtoast("data uploaded: " + file.gettitle()); }
Comments
Post a Comment