Function uploadDataFile

  • Upload a new data file or create a new folder.

    Parameters

    • body: {
          File?: BodyInit;
          Json?: {
              appId?: string;
              connectionId?: string;
              folder?: boolean;
              folderId?: string;
              name: string;
              sourceId?: string;
              tempContentFileId?: string;
          };
      }

      an object with the body content

      • OptionalFile?: BodyInit

        IFormFile form multipart/form-data

      • OptionalJson?: {
            appId?: string;
            connectionId?: string;
            folder?: boolean;
            folderId?: string;
            name: string;
            sourceId?: string;
            tempContentFileId?: string;
        }

        See PostDataFileRequest schema which defines request structure. See model.

        • OptionalappId?: string

          If this file should be bound to the lifecycle of a specific app, this is the ID of this app. If this request is creating a folder, the specification of an app ID is not allowed.

        • OptionalconnectionId?: string

          If present, this is the DataFiles connection that the upload should occur in the context of. If absent, the default is that the upload will occur in the context of the Personal Space DataFiles connection. If the DataFiles connection is different from the one specified when the file or folder was last POSTed or PUT, this will result in a logical move of this file or folder into the new space.

        • Optionalfolder?: boolean

          If true, a folder will be created. If false, a file is created.

        • OptionalfolderId?: string

          If the specified file or folder should be moved to become a a sub-item of an existing folder, this is the ID of this parent folder. Any additional folder path that is present on the Name property will be created as a subfolder hierarchy of this folder. If the FolderID is null, the file or folder specified in the Name property (including any folder prefix on that name), will be created in the root of the space.

        • name: string

          Name that will be given to the file or folder. It should be noted that the '/' character in the name indicates a 'path' separator in a logical folder hierarchy for the name. Names that contain '/'s should be used with the assumption that a logical 'folder hierarchy' is being defined for the full pathname of that file or folder. IE, a '/' is a significant character in the name.

        • OptionalsourceId?: string

          If a SourceId is specified, this is the ID of the existing data file or folder whose content should be copied into the specified data file or folder. That is, for a file instead of the file content being specified in the Data element, it is effectively copied from an existing, previously uploaded file. For a folder, rather than the new folder being empty, it's contents are copied from an existing, previously created folder.

        • OptionaltempContentFileId?: string

          If a TempContentFileId is specified, this is the ID of a previously uploaded temporary content file whose content should be copied into the specified data file. That is, instead of the file content being specified in the Data element, it is effectively copied from an existing, previously uploaded file. The expectation is that this file was previously uploaded to the temporary content service, and the ID specified here is the one returned from the temp content upload request. This option does not apply when POSTing a folder.

    • Optionaloptions: ApiCallOptions

    Returns Promise<UploadDataFileHttpResponse>

    UploadDataFileHttpError