Upload a file
Name
upload_file
Description
Uploads a file. If file exits it does not overwrite. If you like to overwrite existing file then use [Replace file data] endpoint. It requires FileId you like to replace. Get file id by calling list_parent_items or list_files endpoint (Search for file name and get id). Google API does not allow to perform create or replace in one operation. [API reference]
Related Tables
Parameters
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description |
---|---|---|---|---|---|
Id |
DT_WSTR
|
nvarchar(440)
|
440 | False |
|
Kind |
DT_WSTR
|
nvarchar(200)
|
200 | False |
|
Name |
DT_WSTR
|
nvarchar(780)
|
780 | False |
|
MimeType |
DT_WSTR
|
nvarchar(650)
|
650 | False |
|
FileSize |
DT_I8
|
bigint
|
False |
||
DriveId |
DT_WSTR
|
nvarchar(4000)
|
4000 | False |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Examples
SSIS
Use Google Drive Connector in API Source component to read data or in API Destination component to read/write data:
Insert into Files table using API Destination
This Endpoint belongs to Files table, therefore you cannot work with it directly. Use this table and table-operation pair instead:

ODBC application
Use these SQL queries in your ODBC application data source:
Upload a file
SELECT * FROM upload_file
WITH
(
"FileName" = 'myfile.ext',
"DiskFilePath" = 'abcd-1234-diskfilepath'
)
Upload a file with INSERT keyword
Upload a file with INSERT keyword. Advantage of INSERT is you can use Bulk option using SOURCE clause. This way you can upload many files
INSERT INTO Files
WITH (FileName='My filename'
,DiskFilePath='C:\MyFolder\Mymyfile.ext'
,ParentFolderId='root'
)
--You can get ParentFolderId by selecting from 'list_folders' endpoint or just use 'root'
upload_file
endpoint belongs to
Files
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Upload a file
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM upload_file
WITH
(
"FileName" = ''myfile.ext'',
"DiskFilePath" = ''abcd-1234-diskfilepath''
)';
EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];
Upload a file with INSERT keyword
Upload a file with INSERT keyword. Advantage of INSERT is you can use Bulk option using SOURCE clause. This way you can upload many files
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Files
WITH (FileName=''My filename''
,DiskFilePath=''C:\MyFolder\Mymyfile.ext''
,ParentFolderId=''root''
)
--You can get ParentFolderId by selecting from ''list_folders'' endpoint or just use ''root''';
EXEC (@MyQuery) AT [LS_TO_GOOGLE_DRIVE_IN_GATEWAY];
upload_file
endpoint belongs to
Files
table(s), and can therefore be used via those table(s).