EndPoint Upload a file (with overwrite action)
Name
upload_file_overwrite
Description
Uploads a file (if file with same name exists then overwrite else create a new file). [API reference]
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:
Upload a file (with overwrite action) using API Source

Upload a file (with overwrite action) using API Destination

ODBC application
Use these SQL queries in your ODBC application data source:
Upload local file to google shared drive folder (Overwrite if exists)
Upload a local file to google shared drive folder for which user has access. Donot set DriveId to upload to MyDrive rather than sahred drive.
SELECT *
FROM upload_file_overwrite
WITH(
DriveId='' --for my drive keep blank
--DriveId='0AC00HWQH144cUk9PVA' --team drive id (keep blank for uploading to my drive)
, DiskFilePath='C:\temp\dump.csv' --source file path
, FileName='dump.csv' --target file name
, ParentFolderId='root'
--OR--
--, ParentFolderId='1PRySfNNjWIp9ZAnhPh-u9tKRj3QOETSq'
--, FileOverwriteMode='AlwaysOverwrite'
--OR--
--, FileOverwriteMode='FailIfExists'
--, KeepRevisionForever='false'
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Upload local file to google shared drive folder (Overwrite if exists)
Upload a local file to google shared drive folder for which user has access. Donot set DriveId to upload to MyDrive rather than sahred drive.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM upload_file_overwrite
WITH(
DriveId='''' --for my drive keep blank
--DriveId=''0AC00HWQH144cUk9PVA'' --team drive id (keep blank for uploading to my drive)
, DiskFilePath=''C:\temp\dump.csv'' --source file path
, FileName=''dump.csv'' --target file name
, ParentFolderId=''root''
--OR--
--, ParentFolderId=''1PRySfNNjWIp9ZAnhPh-u9tKRj3QOETSq''
--, FileOverwriteMode=''AlwaysOverwrite''
--OR--
--, FileOverwriteMode=''FailIfExists''
--, KeepRevisionForever=''false''
)';
EXEC (@MyQuery) AT [LINKED_SERVER_TO_GOOGLE_DRIVE_IN_DATA_GATEWAY];