UNPKG

asposehtmlcloud

Version:
313 lines (236 loc) 9.51 kB
# Asposehtmlcloud.FileApi All URIs are relative to *https://localhost:5000/v3.0* Method | HTTP request | Description ------------- | ------------- | ------------- [**copyFile**](FileApi.md#copyFile) | **PUT** /html/storage/file/copy/{srcPath} | Copy file [**deleteFile**](FileApi.md#deleteFile) | **DELETE** /html/storage/file/{path} | Delete file [**downloadFile**](FileApi.md#downloadFile) | **GET** /html/storage/file/{path} | Download file [**moveFile**](FileApi.md#moveFile) | **PUT** /html/storage/file/move/{srcPath} | Move file [**uploadFile**](FileApi.md#uploadFile) | **PUT** /html/storage/file/{path} | Upload file <a name="copyFile"></a> # **copyFile** > copyFile(srcPath, destPath, opts) Copy file ### Example ```javascript var Asposehtmlcloud = require('asposehtmlcloud'); var conf = { "basePath":"https://api.aspose.cloud/v3.0", "authPath":"https://api.aspose.cloud/connect/token", "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "testResult":"/testresult/", "testData":"/testdata/", "remoteFolder":"HtmlTestDoc/", "defaultUserAgent":"Webkit" }; var apiInstance = new Asposehtmlcloud.StorageApi(conf); var srcPath = "srcPath_example"; // String | Source file path e.g. '/folder/file.ext' var destPath = "destPath_example"; // String | Destination file path var opts = { 'srcStorageName': "srcStorageName_example", // String | Source storage name 'destStorageName': "destStorageName_example", // String | Destination storage name 'versionId': "versionId_example" // String | File version ID to copy }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully.'); } }; apiInstance.copyFile(srcPath, destPath, opts, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **srcPath** | **String**| Source file path e.g. &#39;/folder/file.ext&#39; | **destPath** | **String**| Destination file path | **srcStorageName** | **String**| Source storage name | [optional] **destStorageName** | **String**| Destination storage name | [optional] **versionId** | **String**| File version ID to copy | [optional] ### Return type null (empty response body) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json <a name="deleteFile"></a> # **deleteFile** > deleteFile(path, opts) Delete file ### Example ```javascript var Asposehtmlcloud = require('asposehtmlcloud'); var conf = { "basePath":"https://api.aspose.cloud/v3.0", "authPath":"https://api.aspose.cloud/connect/token", "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "testResult":"/testresult/", "testData":"/testdata/", "remoteFolder":"HtmlTestDoc/", "defaultUserAgent":"Webkit" }; var apiInstance = new Asposehtmlcloud.StorageApi(conf); var path = "path_example"; // String | File path e.g. '/folder/file.ext' var opts = { 'storageName': "storageName_example", // String | Storage name 'versionId': "versionId_example" // String | File version ID to delete }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully.'); } }; apiInstance.deleteFile(path, opts, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **path** | **String**| File path e.g. &#39;/folder/file.ext&#39; | **storageName** | **String**| Storage name | [optional] **versionId** | **String**| File version ID to delete | [optional] ### Return type null (empty response body) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json <a name="downloadFile"></a> # **downloadFile** > File downloadFile(path, opts) Download file ### Example ```javascript var Asposehtmlcloud = require('asposehtmlcloud'); var conf = { "basePath":"https://api.aspose.cloud/v3.0", "authPath":"https://api.aspose.cloud/connect/token", "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "testResult":"/testresult/", "testData":"/testdata/", "remoteFolder":"HtmlTestDoc/", "defaultUserAgent":"Webkit" }; var apiInstance = new Asposehtmlcloud.StorageApi(conf); var path = "path_example"; // String | File path e.g. '/folder/file.ext' var opts = { 'storageName': "storageName_example", // String | Storage name 'versionId': "versionId_example" // String | File version ID to download }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; apiInstance.downloadFile(path, opts, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **path** | **String**| File path e.g. &#39;/folder/file.ext&#39; | **storageName** | **String**| Storage name | [optional] **versionId** | **String**| File version ID to download | [optional] ### Return type **File** ### HTTP request headers - **Content-Type**: application/json - **Accept**: multipart/form-data <a name="moveFile"></a> # **moveFile** > moveFile(srcPath, destPath, opts) Move file ### Example ```javascript var Asposehtmlcloud = require('asposehtmlcloud'); var conf = { "basePath":"https://api.aspose.cloud/v3.0", "authPath":"https://api.aspose.cloud/connect/token", "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "testResult":"/testresult/", "testData":"/testdata/", "remoteFolder":"HtmlTestDoc/", "defaultUserAgent":"Webkit" }; var apiInstance = new Asposehtmlcloud.StorageApi(conf); var srcPath = "srcPath_example"; // String | Source file path e.g. '/src.ext' var destPath = "destPath_example"; // String | Destination file path e.g. '/dest.ext' var opts = { 'srcStorageName': "srcStorageName_example", // String | Source storage name 'destStorageName': "destStorageName_example", // String | Destination storage name 'versionId': "versionId_example" // String | File version ID to move }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully.'); } }; apiInstance.moveFile(srcPath, destPath, opts, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **srcPath** | **String**| Source file path e.g. &#39;/src.ext&#39; | **destPath** | **String**| Destination file path e.g. &#39;/dest.ext&#39; | **srcStorageName** | **String**| Source storage name | [optional] **destStorageName** | **String**| Destination storage name | [optional] **versionId** | **String**| File version ID to move | [optional] ### Return type null (empty response body) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json <a name="uploadFile"></a> # **uploadFile** > FilesUploadResult uploadFile(path, file, opts) Upload file ### Example ```javascript var Asposehtmlcloud = require('asposehtmlcloud'); var conf = { "basePath":"https://api.aspose.cloud/v3.0", "authPath":"https://api.aspose.cloud/connect/token", "apiKey":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "appSID":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "testResult":"/testresult/", "testData":"/testdata/", "remoteFolder":"HtmlTestDoc/", "defaultUserAgent":"Webkit" }; <<<<<<< HEAD var apiInstance = new Asposehtmlcloud.StorageApi(); ======= var apiInstance = new Asposehtmlcloud.StorageApi(conf); >>>>>>> multipart var path = "path_example"; // String | Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. var file = "/path/to/file.txt"; // File | File to upload var opts = { 'storageName': "storageName_example" // String | Storage name }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; apiInstance.uploadFile(path, file, opts, callback); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **path** | **String**| Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. | **file** | **File**| File to upload | **storageName** | **String**| Storage name | [optional] ### Return type [**FilesUploadResult**](FilesUploadResult.md) ### HTTP request headers - **Content-Type**: multipart/form-data - **Accept**: application/json