2016-06-11 3 views
-1

파일 이름이 동일하면 건너 뛸 수 있도록 파일을 Google 드라이브 폴더에 업로드하고 싶습니다. 아래 코드를 사용하여 파일을 Google 드라이브에 업로드 할 수 있습니다. 하지만 폴더 안에 파일 이름을 가져 오는 방법은 무엇입니까? 나는 모든 PARAM에서 통과 할 때 나는 구글 REST document 말하는 겁니다Google API REST FilesInFolder 이름 가져 오기

File newFile = GoogleDriveHelper.uploadFile(service, dir, directoryId); 

, 그것은 Google 드라이브의 아이디를 반환합니다.

조언을위한 Thx!

답변

1

here을 확인하여이 기능에 fileId를 전달하십시오. fileId는 here

public static void printFile(DriveService service,String fileId) 
     { 
      try 
      { 
       File file = service.Files.Get(fileId).Execute(); 
       Console.WriteLine("Title: " + file.Title); 

      } 
      catch (Exception e) 
      { 
       Console.WriteLine("An error occurred: " + e.Message); 
      } 
     } 
+0

thx 마이크에서 가져올 수 있습니다. 작동한다. – Yeep

관련 문제