uploadDoc            package:RGoogleDocs            R Documentation

_A_d_d _o_r _r_e_m_o_v_e _a _d_o_c_u_m_e_n_t

_D_e_s_c_r_i_p_t_i_o_n:

     These functions allow the caller to manipulate the collection of
     documents in the Google Docs account. One can upload a document
     from the local machine. And one can remove or delete a document
     from the remote repository.

_U_s_a_g_e:

     uploadDoc(content, con, name, type = as.character(findType(content)), 
                binary = FALSE, asText = FALSE, ...)
     deleteDoc(doc, con = getConnection(auth), auth)

_A_r_g_u_m_e_n_t_s:

 content: the name of a local file or the actual content of a document
          to be uploaded.

     doc: the name of the Google document to be removed.

     con: the CURL connection to the Google Docs API which has been 
          authenticated. See 'getGoogleDocsConnection'.

    name: the name of the new document to be created (or the document
          to be replaced).

    type: the type of document. This can be the MIME type  (e.g.
          "text/csv")  or the short hand, e.g. "csv", "odt", ...,
          capitalized or uncapitalized. The type is matched in the
          vector DocTypeExtensions.

  binary: a logical value indicating whether the content being uploaded
          is binary or not.

  asText: a logical indicating whether the value of 'content' is to be
          treated as the content to be uploaded ('TRUE') or the name of
          a file ('FALSE').

     ...: additional arguments to be passed to the 'curlPerform' call.

    auth: the auth token returned from a call to 'getGoogleAuth' and
          used to initialize a connection.

_V_a_l_u_e:

     'uploadDoc' returns an object of class 'GoogleDocument' describing
     the newly uploaded document.

     'deleteDoc' returns 0 if the operation succeeded or a CURL error
     if it failed.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_S_e_e _A_l_s_o:

     'getGoogleDocsConnection'

_E_x_a_m_p_l_e_s:

     if(exists("GoogleDocsPassword")) {
               # getGoogleDocsConnection("my login", "my password")

       con = getGoogleDocsConnection(names(GoogleDocsPassword), GoogleDocsPassword)

       x = "1, 2, 3\n4, 5, 6\n"
       uploadDoc(x, con, name = "direct csv", type = "csv")

       deleteDoc("Untitled Presentation", con)
     }

