     return multipartRequestBody
 
   insert: (title, content, callback) ->
-    console.log('insert file')
     multipartRequestBody = this.requestBody(title, content)
     request = gapi.client.request({
       'path': '/upload/drive/v2/files',

        # immediate: trueが失敗したときはflaseで再チャレンジ
        # 今度はダイアログが開く
        if (authResult && !authResult.error)
          console.log("immediate true")
          that.authResult = authResult
        else
          console.log("immediate false")
          gapi.auth.authorize({
            'client_id': this.gdrive.CLIENT_ID,
            'scope': this.gdrive.SCOPES,

    )

  upload: (title, content) ->
    if this.file == null
      this.insert(title, content)
    else
      this.update(title, content)

  insert: (title, content) ->
    that = this
    gapi.client.load('drive', 'v2', ->
      that.gdrive.insert(title, content, (file)->
        that.file = file
        )
    )

  update: (title, content) ->
    that = this
    gapi.client.load('drive', 'v2', ->
      that.gdrive.update(that.file.id, title, content, (file)->
        that.file = file
        )
    )
