首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >如何在导入行-融合表中附加文件

如何在导入行-融合表中附加文件
EN

Stack Overflow用户
提问于 2014-02-28 21:14:27
回答 1查看 592关注 0票数 2

我想要importRows to fusion table https://developers.google.com/fusiontables/docs/v1/reference/table/importRows

我使用的是google-api-php-client,文档(如下所示)中没有任何关于文件的内容。如何附加文件?

代码语言:javascript
代码运行次数:0
运行
复制
 /**
   * Import more rows into a table. (table.importRows)
   *
   * @param string $tableId
   * The table into which new rows are being imported.
   * @param array $optParams Optional parameters.
   *
   * @opt_param int startLine
   * The index of the first line from which to start importing, inclusive. Default is 0.
   * @opt_param bool isStrict
   * Whether the CSV must have the same number of values for each row. If false, rows with fewer
    * values will be padded with empty values. Default is true.
   * @opt_param string encoding
   * The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the
    * encoding.
   * @opt_param string delimiter
   * The delimiter used to separate cell values. This can only consist of a single character. Default
    * is ','.
   * @opt_param int endLine
   * The index of the last line from which to start importing, exclusive. Thus, the number of
    * imported lines is endLine - startLine. If this parameter is not provided, the file will be
    * imported until the last line of the file. If endLine is negative, then the imported content will
    * exclude the last endLine lines. That is, if endline is negative, no line will be imported whose
    * index is greater than N + endLine where N is the number of lines in the file, and the number of
    * imported lines will be N + endLine - startLine.
   * @return Google_Service_Fusiontables_Import
   */
  public function importRows($tableId, $optParams = array())
  {
    $params = array('tableId' => $tableId);
    $params = array_merge($params, $optParams);
    return $this->call('importRows', array($params), "Google_Service_Fusiontables_Import");
  }
EN

回答 1

Stack Overflow用户

发布于 2014-03-04 17:05:10

正如你所能做到的,see in the documentation importRows会让你上传你想要导入的文件:

此方法支持/upload URI,并接受具有以下特征的上载媒体:

  • 最大文件大小:100MB
  • 可接受的媒体MIME类型: application/octet-stream

此方法通过两个单独的URI提供媒体上载功能。有关更多详细信息,请参阅媒体上传文档。

POST https://www.googleapis.com/upload/fusiontables/v1/tables/tableId/import

  • Metadata上载URI,用于媒体上载请求: POST https://www.googleapis.com/fusiontables/v1/tables/tableId/import

URI,用于仅限元数据的请求:POST

现在,您所要做的就是将文件上传到相应的URL。

There are several教程,向您展示如何使用PHP完成此操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22096205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档