目录

Modifies a file using the multipart method and uploads it to Drive.  

Request

HTTP Request

PUT
https://drive.cloud.hicloud.com/upload/drive/v1/files/{fileId}?uploadType=multipart

Parameters

*Some parameters are mandatory.

Parameter NameType
Description
fileIdstringpathFile ID. (Mandatory)
uploadTypestringqueryType of an upload request. (Mandatory)
addParentFolderstringqueryA comma-separated list of parent IDs to add. Only the first parent ID in the list is used. Update requests must always use addParentFolder and removeParentFolder to modify the parent list.
removeParentFolder
stringqueryA comma-separated list of parent IDs to add. Only the first parent ID in the list is used. Update requests must always use addParentFolder and removeParentFolder to modify the parent list.
fieldsstringquery  Fields in the request, which are in the partial response format.
formstringquery  Media format.
prettyPrintbooleanquery  Indicates whether to return a response in a human-readable format.
quotaIdstringquery  User identifier, consisting of 40 characters at maximum. It is used to restrict the number of API calls of an individual user.
callbackstringqueryCallback function used in JSONP requests.
x-hw-trace-idstringheaderID used for service tracing.
x-hw-app-idstringheaderApp ID.
versionstringheaderSDK version number.
x-hw-terminalstringheader Device model. 
x-hw-osstringheaderDevice operating system. 
unionIDstringheaderOpen user ID. 
User-AgentstringheaderApp version number or ID.

Request Body

In the request body, provide data with the following structure:

Parameter NameTypeDescription
appSettings[]stringCustom properties of the requesting app.            
contentExtras.thumbnail.contentstringThumbnail data encoded with Base64.
contentExtras.thumbnail.mimeTypestringMIME type of the thumbnail.
writerHasCopyPermission            booleanIndicates whether the current user (assuming the writer role) has permission to copy this file.
createdTimestringTime when the file was created.
descriptionstringShort description of the file.
mimeTypestringMIME type of the file.
editedTime            stringLast time the file was modified.
fileName            stringName of the file.
originalFilenamestringThe original name of the file.
properties[]stringCustom file properties that are universally visible.            
favorite            booleanIndicates whether the file has been favorited.            
writersHasSharePermission            booleanIndicates whether the current user (assuming the writer role) has permission to share this file.            
sha256
           
stringSHA-256 value for the file.            

File content.

Response

If successful, this method returns a response body with the following structure:

  1. {
  2.    "category": "drive#file",
  3.    "id": "string",
  4.    "fileName": "string",
  5.    "mimeType": "string",
  6.    "description": "string",
  7.    "favorite": true,
  8.    "recycled": true,
  9.    "directlyRecycled": true,
  10.    "recyclingUser": {
  11.        "category": "drive#user",
  12.        "displayName": "string",
  13.        "profilePhotoLink": "string",
  14.        "me": true,
  15.        "permissionId": "string",
  16.        "userAccount": "string"
  17.    },
  18.    "recycledTime": "2019-12-10T13:06:04.519Z",
  19.    "parentFolder": ["string"],
  20.    "properties": {
  21.        "additionalProp1": "string",
  22.        "additionalProp2": "string",
  23.        "additionalProp3": "string"
  24.    },
  25.    "appSettings": {
  26.        "additionalProp1": "string",
  27.        "additionalProp2": "string",
  28.        "additionalProp3": "string"
  29.    },
  30.    "containers": ["drive"],
  31.    "version": 0,
  32.    "contentDownloadLink": "string",
  33.    "iconDownloadLink": "string",
  34.    "existThumbnail": true,
  35.    "thumbnailDownloadLink": "string",
  36.    "smallThumbnailDownloadLink": "string",
  37.    "thumbnailVersion": 0,
  38.    "onLineViewLink": "string",
  39.    "createdTime": "2019-12-10T13:06:04.519Z",
  40.    "editedTime": "2019-12-10T13:06:04.519Z",
  41.    "editedByMeTime": "2019-12-10T13:06:04.519Z",
  42.    "editedByMe": true,
  43.    "sharedWithMeTime": "2019-12-10T13:06:04.519Z",
  44.    "sharer": {
  45.        "category": "drive#user",
  46.        "displayName": "string",
  47.        "profilePhotoLink": "string",
  48.        "me": true,
  49.        "permissionId": "string",
  50.        "userAccount": "string"
  51.    },
  52.    "owners": [
  53.    {
  54.        "category": "drive#user",
  55.        "displayName": "string",
  56.        "profilePhotoLink": "string",
  57.        "me": true,
  58.        "permissionId": "string",
  59.        "userAccount": "string"
  60.    }
  61.    ],
  62.    "lastEditor": {
  63.        "category": "drive#user",
  64.        "displayName": "string",
  65.        "profilePhotoLink": "string",
  66.        "me": true,
  67.        "permissionId": "string",
  68.        "userAccount": "string"
  69.    },
  70.    "hasShared": false,
  71.    "ownedByMe": true,
  72.    "capabilities": {
  73.        "addChildNodePermission": true,
  74.        "writerHasChangeCopyPermission": false,
  75.        "commentPermission": true,
  76.        "copyPermission": true,
  77.        "deletePermission": true,
  78.        "deleteChildNodePermission": true,
  79.        "downloadPermission": true,
  80.        "editPermission": true,
  81.        "listChildNodePermission": true,
  82.        "editContentPermission": true,
  83.        "readHistoryVersionPermission": true,
  84.        "removeChildNodePermission": true,
  85.        "renameFilePermission": true,
  86.        "shareFilePermission": false,
  87.        "recyclePermission": true,
  88.        "recycleChildNodePermission": true,
  89.        "unrecyclePermission": true
  90.    },
  91.    "viewersHasCopyContentPermission": false,
  92.    "writerHasCopyPermission": false,
  93.    "writersHasSharePermission": false,
  94.    "permissions": [
  95.    {
  96.        "category": "drive#permission",
  97.        "id": "string",
  98.        "type": "user",
  99.        "role": "owner",
  100.        "userAccount": "string",
  101.        "displayName": "string",
  102.        "expirationTime": "2020-02-24T00:50:54.483Z",
  103.        "deleted": true,
  104.        "canDiscoverFile": true
  105.    }
  106.    ],
  107.    "permissionIds": ["string"],
  108.    "originalFilename": "string",
  109.    "fullFileSuffix": "string",
  110.    "fileSuffix": "string",
  111.    "size": 0,
  112.    "occupiedSpace": 0,
  113.    "pictureMetadata": {
  114.        "width": 0,
  115.        "height": 0,
  116.        "rotation": 0,
  117.        "location": {
  118.            "latitude": 0,
  119.            "longitude": 0,
  120.            "altitude": 0
  121.        },
  122.        "exifTime": "string",
  123.        "cameraMaker": "string",
  124.        "cameraModel": "string",
  125.        "exposureTime": 0,
  126.        "aperture": 0,
  127.        "flashUsed": true,
  128.        "focalLength": 0,
  129.        "isoSpeed": 0,
  130.        "meteringMode": "string",
  131.        "sensor": "string",
  132.        "exposureMode": "string",
  133.        "colorSpace": "string",
  134.        "whiteBalance": "string",
  135.        "exposureBias": 0,
  136.        "maxApertureValue": 0,
  137.        "subjectDistance": 0,
  138.        "lens": "string"
  139.    },
  140.    "videoMetadata": {
  141.        "width": 0,
  142.        "height": 0,
  143.        "durationTime": 0
  144.    },
  145.    "sha256": "string",
  146.    "lastHistoryVersionId": "string",
  147.    "contentVersion": "string"
  148. }

idstringID of the file.
categorystringResource type. The value is always drive#file.
idstringID of the file.
fileName            stringName of the file.
mimeTypestringMIME type of the file.
descriptionstringShort description of the file.
favorite            booleanIndicates whether the file has been favorited.
recycled            booleanIndicates whether the file has been moved to the recycle bin.
directlyRecycled            booleanIndicates whether the file has been explicitly trashed.
recyclingUser.category            stringUser type. The value is always drive#user.
recyclingUser.displayNamestringDisplay name for this user.
recyclingUser.profilePhotoLink            stringLink to the user's profile picture, which is not returned by default.
recyclingUser.me            booleanIndicates whether this user is the requesting user.
recyclingUser.permissionIdstringPermission ID.
recyclingUser.userAccountstringAccount of the user, which is not returned by default.
recycledTime            stringTime when the item was moved to the recycle bin.
parentFolder[]stringParent folder.
properties[]stringCustom file properties that are universally visible.
appSettings[]stringCustom properties of the requesting app.
containers[]stringSpaces that contain the file. Values: drive and applicationData
versionintegerVersion number of the file.
contentDownloadLink            stringLink for downloading the file in a browser.
iconDownloadLink            stringLink to the file's icon.
existThumbnail            booleanIndicates whether the file has a thumbnail.
thumbnailDownloadLink            stringLink to the file's large thumbnail.
smallThumbnailDownloadLinkstringLink to the file's small thumbnail.
thumbnailVersionintegerVersion number for the thumbnail.
onLineViewLinkstringLink to view the file online.
createdTimestringTime when the file was created.
editedTime            stringLast time the file was modified.
editedByMeTime            stringLast time the file was modified by the user.
editedByMe            booleanIndicates whether the file was modified by the user.
sharedWithMeTimestringTime at which the file was shared with the user.
sharer.category            stringUser type. The value is always drive#user.
sharer.displayNamestringDisplay name for this user.
sharer.profilePhotoLink            stringLink to the user's profile picture, which is not returned by default.
sharer.me            booleanIndicates whether this user is the requesting user.
sharer.permissionIdstringPermission ID.
sharer.userAccountstringAccount of the user, which is not returned by default.
owners.category            stringUser type. The value is always drive#user.
owners.displayNamestringDisplay name for this user.
owners.profilePhotoLink            stringLink to the user's profile picture, which is not returned by default.
owners.me            booleanIndicates whether this user is the requesting user.
owners.permissionIdstringPermission ID.
owners.userAccountstringAccount of the user, which is not returned by default.
lastEditor.category            stringUser type. The value is always drive#user.
lastEditor.displayNamestringDisplay name for this user.
lastEditor.profilePhotoLink            stringLink to the user's profile picture, which is not returned by default.
lastEditor.me            booleanIndicates whether this user is the requesting user.
lastEditor.permissionIdstringPermission ID.
lastEditor.userAccountstringAccount of the user, which is not returned by default.
hasShared            booleanIndicates whether the file has been shared.
ownedByMebooleanIndicates whether the user owns the file.
capabilities.addChildNodePermission            booleanIndicates whether the current user has permission to create subfolders to a particular folder.
capabilities.writerHasChangeCopyPermission            booleanIndicates whether the current user (assuming the writer role) has permission to change the content of this file.
capabilities.commentPermission            booleanIndicates whether the current user has permission to comment on this file.
capabilities.copyPermission            booleanIndicates whether the current user has permission to copy this file.
capabilities.deletePermission            booleanIndicates whether the current user has permission to delete this file.
capabilities.deleteChildNodePermission            booleanIndicates whether the current user has permission to delete subfolders from this folder.
capabilities.downloadPermission            booleanIndicates whether the current user has permission to download this file.
capabilities.editPermission            booleanIndicates whether the current has permission to edit this file.
capabilities.listChildNodePermission            booleanIndicates whether the current user has permission to list subfolders in this folder.
capabilities.editContentPermission            booleanIndicates whether the current user has permission to modify the content of this file.
capabilities.readHistoryVersionPermission            booleanIndicates whether the current user has permission to read revisions of this file.
capabilities.removeChildNodePermission            booleanIndicates whether the current user has permission to remove subfolders from this folder.
capabilities.renameFilePermission            booleanIndicates whether the current user has permission to rename this file.
capabilities.shareFilePermission            booleanIndicates whether the current user has permission to share this file.
capabilities.recyclePermission            booleanIndicates whether the current user has permission to move this file to the recycle bin.
capabilities.recycleChildNodePermission            booleanIndicates whether the current user has permission to move the subfolders in this folder to the recycle bin.
capabilities.unrecyclePermission            booleanIndicates whether the current user has permission to restore this file from the recycle bin.
viewersHasCopyContentPermission            booleanIndicates whether the current user has permission to copy the content of this file.
writerHasCopyPermission            booleanIndicates whether the current user (assuming the writer role) has permission to copy this file.
writersHasSharePermission            booleanIndicates whether the current user (assuming the writer role) has permission to share this file.
permissions[]
           
stringList of permissions for the file.
permissions.categorystringPermission type. The value is always drive#permission.
permissions.idstringPermission ID.
permissions.typestringGrantee type. Values: user and anyone.
permissions.rolestringRole granted by the permission. Values: owner, writer, commenter, and reader.
permissions.userAccountstringUser account.
permissions.displayNamestringDisplay name for the permission.
permissions.expirationTimestringTime when the permission will expire.
permissions.deletedboolean            Indicates whether the permission is deleted.
permissions.canDiscoverFilebooleanIndicates whether the permission allows the file to be searched. It is applicable only to permissions of the anyone type.
originalFilenamestringOriginal name of the file.
fullFileSuffix            stringFull file extension extracted from the name field. It is the substring that comes immediately after the dot character in the filename.
fileSuffix            stringFinal component offullFileSuffix.
sizeintegerSize of file content.
occupiedSpace            integerActual storage used by the file.
pictureMetadata.widthintegerImage width.
pictureMetadata.heightintegerImage height.
pictureMetadata.rotationintegerImage rotation angle.
pictureMetadata.location.latitudenumberLatitude stored in the image.
pictureMetadata.location.longitudenumberLongitude stored in the image.
pictureMetadata.location.altitudenumberAltitude stored in the image.
pictureMetadata.exifTimestringDate and time the image was created (EXIF DateTime).
pictureMetadata.cameraMakerstringMaker of the camera that was used to create the image.
pictureMetadata.cameraModelstringModel of the camera that was used to create the image.
pictureMetadata.exposureTimenumberLength of the exposure, in seconds.
pictureMetadata.aperturenumberAperture (f-number) used when creating the image.
pictureMetadata.flashUsedbooleanIndicates whether a flash was used to create the image.
pictureMetadata.focalLengthnumberFocal length used when creating the image, in millimeters.
pictureMetadata.isoSpeedintegerISO speed used when creating the image.
pictureMetadata.meteringModestringMetering mode used when creating the image.
pictureMetadata.sensorstringType of sensor used when creating the image.
pictureMetadata.exposureModestringExposure mode used when creating the image.
pictureMetadata.colorSpacestringColor space of the image.
pictureMetadata.whiteBalancestringWhite balance mode used when creating the image.
pictureMetadata.exposureBiasnumberExposure bias of the image (APEX value).
pictureMetadata.maxApertureValuenumberMaximum aperture used when creating the image (APEX value).
pictureMetadata.subjectDistanceintegerDistance to the subject of the image, in meters.
pictureMetadata.lensstringLens used for creating the image.
videoMetadata.widthintegerWidth of the video.
videoMetadata.heightintegerHeight of the video.
videoMetadata.durationTime            integerDuration of the video in milliseconds.
sha256stringSHA-256 value for the file.
lastHistoryVersionIdstringID of the latest version.
contentVersionstringContent version number.