Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK, it hides the File API calls and lets you use GroupDocs Cloud features in a native way for your preferred language.
usingGroupDocs.Viewer.Cloud.Sdk.Api;usingGroupDocs.Viewer.Cloud.Sdk.Client;usingGroupDocs.Viewer.Cloud.Sdk.Model.Requests;usingSystem;namespaceGroupDocs.Viewer.Cloud.Examples.CSharp{// Download_FileclassDownload_File{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newFileApi(configuration);try{varrequest=newDownloadFileRequest("viewerdocs/one-page.docx",Common.MyStorage);varresponse=apiInstance.DownloadFile(request);Console.WriteLine("Expected response type is Stream: "+response.Length.ToString());}catch(Exceptione){Console.WriteLine("Exception while calling FileApi: "+e.Message);}}}}
packageexamples.Working_With_Files;importjava.io.File;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Java_Download_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{DownloadFileRequestrequest=newDownloadFileRequest("viewers\\one-page.docx",Utils.MYStorage,null);Fileresponse=apiInstance.downloadFile(request);System.err.println("Expected response type is File: "+response.length());}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
<?phpinclude(dirname(__DIR__).'\CommonUtils.php');try{$apiInstance=CommonUtils::GetFileApiInstance();$request=newGroupDocs\Viewer\Model\Requests\DownloadFileRequest("viewerdocs\\one-page.docx",CommonUtils::$MyStorage,null);$response=$apiInstance->downloadFile($request);echo"Expected response type is File: ",strlen($response);}catch(Exception$e){echo"Something went wrong: ",$e->getMessage(),"\n";}?>
"use strict";classViewer_Node_Download_File{staticRun(){varrequest=newgroupdocs_viewer_cloud_1.DownloadFileRequest("viewerdocs/one-page.docx",myStorage);fileApi.downloadFile(request).then(function(response){console.log("Expected response type is Stream: "+response.length);}).catch(function(error){console.log("Error: "+error.message);});}}module.exports=Viewer_Node_Download_File;
# Import modulesimportgroupdocs_viewer_cloudfromCommon_Utilities.UtilsimportCommon_UtilitiesclassViewer_Python_Download_File:@classmethoddefRun(self):# Create instance of the APIapi=Common_Utilities.Get_FileApi_Instance()try:request=groupdocs_viewer_cloud.DownloadFileRequest("viewerdocs\\one-page.docx",Common_Utilities.myStorage)response=api.download_file(request)print("Expected response type is Stream: "+str(len(response)))exceptgroupdocs_viewer_cloud.ApiExceptionase:print("Exception while calling API: {0}".format(e.message))
# Load the gemrequire'groupdocs_viewer_cloud'require'common_utilities/Utils.rb'classWorking_With_Filesdefself.Viewer_Ruby_Download_File()# Getting instance of the API$api=Common_Utilities.Get_FileApi_Instance()$request=GroupDocsViewerCloud::DownloadFileRequest.new("viewerdocs/one-page.docx",$myStorage)$response=$api.download_file($request)puts("Expected response type is Stream: "+($response).to_s)endend
packageexamples.Working_With_Files;importjava.io.File;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Android_Download_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{DownloadFileRequestrequest=newDownloadFileRequest("viewers\\one-page.docx",Utils.MYStorage,null);Fileresponse=apiInstance.downloadFile(request);System.err.println("Expected response type is File: "+response.length());}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK, it hides the File API calls and lets you use GroupDocs for Cloud features in a native way for your preferred language.
usingGroupDocs.Viewer.Cloud.Sdk.Api;usingGroupDocs.Viewer.Cloud.Sdk.Client;usingGroupDocs.Viewer.Cloud.Sdk.Model.Requests;usingSystem;usingSystem.IO;namespaceGroupDocs.Viewer.Cloud.Examples.CSharp{// Upload FileclassUpload_File{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newFileApi(configuration);try{// Open file in IOStream from local/disc.varfileStream=File.Open("..\\..\\..\\Data\\viewerdocs\\one-page.docx",FileMode.Open);varrequest=newUploadFileRequest("viewerdocs/one-page1.docx",fileStream,Common.MyStorage);varresponse=apiInstance.UploadFile(request);Console.WriteLine("Expected response type is FilesUploadResult: "+response.Uploaded.Count.ToString());}catch(Exceptione){Console.WriteLine("Exception while calling FileApi: "+e.Message);}}}}
packageexamples.Working_With_Files;importjava.io.File;importjava.nio.file.Paths;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.*;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Java_Upload_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{FilefileStream=newFile(Paths.get("src\\main\\resources").toAbsolutePath().toString()+"\\viewers\\one-page.docx");UploadFileRequestrequest=newUploadFileRequest("viewers\\one-page1.docx",fileStream,Utils.MYStorage);FilesUploadResultresponse=apiInstance.uploadFile(request);System.out.println("Expected response type is FilesUploadResult: "+response.getUploaded().size());}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
<?phpinclude(dirname(__DIR__).'\CommonUtils.php');try{$apiInstance=CommonUtils::GetFileApiInstance();$fileStream=readfile("..\\resources\\viewerdocs\\one-page.docx");$request=newGroupDocs\Conversion\Model\Requests\UploadFileRequest("viewerdocs\\one-page1.docx",$fileStream,CommonUtils::$MyStorage,null);$response=$apiInstance->downloadFile($request);echo"Expected response type is FilesUploadResult: ",$response;}catch(Exception$e){echo"Something went wrong: ",$e->getMessage(),"\n";}?>
"use strict";classViewer_Node_Upload_File{staticRun(){// Open file in IOStream from local/disc.
varresourcesFolder='./Resources/viewerdocs/one-page.docx';fs.readFile(resourcesFolder,(err,fileStream)=>{varrequest=newgroupdocs_viewer_cloud_1.UploadFileRequest("viewerdocs/one-page1.docx",fileStream,myStorage);fileApi.uploadFile(request).then(function(response){console.log("Expected response type is FilesUploadResult: "+response.uploaded.length);}).catch(function(error){console.log("Error: "+error.message);});});}}module.exports=Viewer_Node_Upload_File;
# Import modulesimportgroupdocs_viewer_cloudfromCommon_Utilities.UtilsimportCommon_UtilitiesclassViewer_Python_Upload_File:@classmethoddefRun(self):# Create instance of the APIapi=Common_Utilities.Get_FileApi_Instance()try:request=groupdocs_viewer_cloud.UploadFileRequest("viewerdocs\\one-page.docx","D:\\ewspace\\GroupDocs.Viewer.Cloud.Python.Examples\\src\\Resources\\viewerdocs\\one-page.docx",Common_Utilities.myStorage)response=api.upload_file(request)print("Expected response type is FilesUploadResult: "+str(response))exceptgroupdocs_viewer_cloud.ApiExceptionase:print("Exception while calling API: {0}".format(e.message))
# Load the gemrequire'groupdocs_viewer_cloud'require'common_utilities/Utils.rb'classWorking_With_Filesdefself.Viewer_Ruby_Upload_File()# Getting instance of the API$api=Common_Utilities.Get_FileApi_Instance()$fileStream=File.new("..\\Resources\\viewerdocs\\one-page.docx","r")$request=GroupDocsViewerCloud::UploadFileRequest.new("viewerdocs/one-page1.docx",$fileStream,$myStorage)$response=$api.upload_file($request)$fileStream.close()puts("Expected response type is FilesUploadResult: "+($response).to_s)endend
packageexamples.Working_With_Files;importjava.io.File;importjava.nio.file.Paths;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.*;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Android_Upload_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{FilefileStream=newFile(Paths.get("src\\main\\resources").toAbsolutePath().toString()+"\\viewers\\one-page.docx");UploadFileRequestrequest=newUploadFileRequest("viewers\\one-page1.docx",fileStream,Utils.MYStorage);FilesUploadResultresponse=apiInstance.uploadFile(request);System.out.println("Expected response type is FilesUploadResult: "+response.getUploaded().size());}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK, it hides the File API calls and lets you use GroupDocs for Cloud features in a native way for your preferred language.
usingGroupDocs.Viewer.Cloud.Sdk.Api;usingGroupDocs.Viewer.Cloud.Sdk.Client;usingGroupDocs.Viewer.Cloud.Sdk.Model.Requests;usingSystem;namespaceGroupDocs.Viewer.Cloud.Examples.CSharp{// Delete FileclassDelete_File{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newFileApi(configuration);try{varrequest=newDeleteFileRequest("viewerdocs1/one-page1.docx",Common.MyStorage);apiInstance.DeleteFile(request);Console.WriteLine("Expected response type is Void: 'viewerdocs1/one-page1.docx' deleted.");}catch(Exceptione){Console.WriteLine("Exception while calling FileApi: "+e.Message);}}}}
packageexamples.Working_With_Files;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Java_Delete_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{DeleteFileRequestrequest=newDeleteFileRequest("viewers1\\one-page1.docx",Utils.MYStorage,null);apiInstance.deleteFile(request);System.out.println("Expected response type is Void: 'viewers1/one-page1.docx' deleted.");}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
<?phpinclude(dirname(__DIR__).'\CommonUtils.php');try{$apiInstance=CommonUtils::GetFileApiInstance();$request=newGroupDocs\Viewer\Model\Requests\DeleteFileRequest("viewerdocs1\\one-page-copied.docx",CommonUtils::$MyStorage);$apiInstance->deleteFile($request);echo"Expected response type is Void: 'viewerdocs1/one-page-copied.docx' file deleted.";}catch(Exception$e){echo"Something went wrong: ",$e->getMessage(),"\n";}?>
"use strict";classViewer_Node_Delete_File{staticRun(){varrequest=newgroupdocs_viewer_cloud_1.DeleteFileRequest("viewerdocs1/one-page1.docx",myStorage);fileApi.deleteFile(request).then(function(response){console.log("Expected response type is Void: 'viewerdocs1/one-page1.docx' deleted.");}).catch(function(error){console.log("Error: "+error.message);});}}module.exports=Viewer_Node_Delete_File;
# Import modulesimportgroupdocs_viewer_cloudfromCommon_Utilities.UtilsimportCommon_UtilitiesclassViewer_Python_Delete_File:@classmethoddefRun(self):# Create instance of the APIapi=Common_Utilities.Get_FileApi_Instance()try:request=groupdocs_viewer_cloud.DeleteFileRequest("viewerdocs1\\one-page.docx",Common_Utilities.myStorage)api.delete_file(request)print("Expected response type is Void: 'viewerdocs1/one-page.docx' deleted.")exceptgroupdocs_viewer_cloud.ApiExceptionase:print("Exception while calling API: {0}".format(e.message))
# Load the gemrequire'groupdocs_viewer_cloud'require'common_utilities/Utils.rb'classWorking_With_Filesdefself.Viewer_Ruby_Delete_File()# Getting instance of the API$api=Common_Utilities.Get_FileApi_Instance()$request=GroupDocsViewerCloud::DeleteFileRequest.new("viewerdocs1/one-page1.docx",$myStorage)$response=$api.delete_file($request)puts("Expected response type is Void: 'viewerdocs1/one-page1.docx' deleted.")endend
packageexamples.Working_With_Files;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Android_Delete_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{DeleteFileRequestrequest=newDeleteFileRequest("viewers1\\one-page1.docx",Utils.MYStorage,null);apiInstance.deleteFile(request);System.out.println("Expected response type is Void: 'viewers1/one-page1.docx' deleted.");}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
Path of the source file including file name and extension e.g. /Folder1/file.ext Required. Can be passed as query string parameter or as part of the URL
destPath
Path of the destination file. Required.
srcStorageName
Name of the storage of source file. If not set, then default storage used
destStorageName
Name of the storage of destination file. If not set, then default storage used
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK, it hides the File API calls and lets you use GroupDocs Cloud features in a native way for your preferred language.
usingGroupDocs.Viewer.Cloud.Sdk.Api;usingGroupDocs.Viewer.Cloud.Sdk.Client;usingGroupDocs.Viewer.Cloud.Sdk.Model.Requests;usingSystem;namespaceGroupDocs.Viewer.Cloud.Examples.CSharp{// Copy FileclassCopy_File{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newFileApi(configuration);try{varrequest=newCopyFileRequest("viewerdocs/one-page1.docx","viewerdocs/one-page-copied.docx",Common.MyStorage,Common.MyStorage);apiInstance.CopyFile(request);Console.WriteLine("Expected response type is Void: 'viewerdocs/one-page1.docx' file copied as 'viewerdocs/one-page-copied.docx'.");}catch(Exceptione){Console.WriteLine("Exception while calling FileApi: "+e.Message);}}}}
packageexamples.Working_With_Files;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Java_Copy_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{CopyFileRequestrequest=newCopyFileRequest("viewers\\one-page.docx","viewers\\one-page-copied.docx",Utils.MYStorage,Utils.MYStorage,null);apiInstance.copyFile(request);System.out.println("Expected response type is Void: 'viewers/one-page1.docx' file copied as 'viewers/one-page-copied.docx'.");}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
<?phpinclude(dirname(__DIR__).'\CommonUtils.php');try{$apiInstance=CommonUtils::GetFileApiInstance();$request=newGroupDocs\Viewer\Model\Requests\CopyFileRequest("viewerdocs\\one-page.docx","viewerdocs\\one-page-copied.docx",CommonUtils::$MyStorage,CommonUtils::$MyStorage);$apiInstance->copyFile($request);echo"Expected response type is Void: 'viewerdocs/one-page.docx' file copied as 'viewerdocs/one-page-copied.docx'.";}catch(Exception$e){echo"Something went wrong: ",$e->getMessage(),"\n";}?>
"use strict";classViewer_Node_Copy_File{staticRun(){varrequest=newgroupdocs_viewer_cloud_1.CopyFileRequest("viewerdocs/one-page1.docx","viewerdocs/one-page-copied.docx",myStorage,myStorage);fileApi.copyFile(request).then(function(response){console.log("Expected response type is Void: 'viewerdocs/one-page1.docx' file copied as 'viewerdocs/one-page-copied.docx'.");}).catch(function(error){console.log("Error: "+error.message);});}}module.exports=Viewer_Node_Copy_File;
# Import modulesimportgroupdocs_viewer_cloudfromCommon_Utilities.UtilsimportCommon_UtilitiesclassViewer_Python_Copy_File:@classmethoddefRun(self):# Create instance of the APIapi=Common_Utilities.Get_FileApi_Instance()try:request=groupdocs_viewer_cloud.CopyFileRequest("viewerdocs\\one-page.docx","viewerdocs\\one-page-copied.docx",Common_Utilities.myStorage,Common_Utilities.myStorage)api.copy_file(request)print("Expected response type is Void: 'viewerdocs/one-page.docx' file copied as 'viewerdocs/one-page-copied.docx'.")exceptgroupdocs_viewer_cloud.ApiExceptionase:print("Exception while calling API: {0}".format(e.message))
# Load the gemrequire'groupdocs_viewer_cloud'require'common_utilities/Utils.rb'classWorking_With_Filesdefself.Viewer_Ruby_Copy_File()# Getting instance of the API$api=Common_Utilities.Get_FileApi_Instance()$request=GroupDocsViewerCloud::CopyFileRequest.new("viewerdocs/one-page1.docx","viewerdocs/one-page-copied.docx",$myStorage,$myStorage)$response=$api.copy_file($request)puts("Expected response type is Void: 'viewerdocs/one-page1.docx' file copied as 'viewerdocs/one-page-copied.docx'.")endend
packageexamples.Working_With_Files;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Android_Copy_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{CopyFileRequestrequest=newCopyFileRequest("viewers\\one-page.docx","viewers\\one-page-copied.docx",Utils.MYStorage,Utils.MYStorage,null);apiInstance.copyFile(request);System.out.println("Expected response type is Void: 'viewers/one-page1.docx' file copied as 'viewers/one-page-copied.docx'.");}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
Path of the source file including file name and extension e.g. /Folder1/file.ext Required. Can be passed as query string parameter or as part of the URL
destPath
Path of the destination file. Required.
srcStorageName
Name of the storage of source file. If not set, then default storage used
destStorageName
Name of the storage of destination file. If not set, then default storage used
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API SDKs in many development languages in order to make it easier to integrate with us. If you use SDK, it hides the File API calls and lets you use GroupDocs for Cloud features in a native way for your preferred language.
usingGroupDocs.Viewer.Cloud.Sdk.Api;usingGroupDocs.Viewer.Cloud.Sdk.Client;usingGroupDocs.Viewer.Cloud.Sdk.Model.Requests;usingSystem;namespaceGroupDocs.Viewer.Cloud.Examples.CSharp{// Move FileclassMove_File{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newFileApi(configuration);try{varrequest=newMoveFileRequest("viewerdocs/one-page1.docx","viewerdocs1/one-page1.docx",Common.MyStorage,Common.MyStorage);apiInstance.MoveFile(request);Console.WriteLine("Expected response type is Void: 'viewerdocs/one-page1.docx' file moved to 'viewerdocs1/one-page1.docx'.");}catch(Exceptione){Console.WriteLine("Exception while calling FileApi: "+e.Message);}}}}
packageexamples.Working_With_Files;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Java_Move_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{MoveFileRequestrequest=newMoveFileRequest("viewers\\one-page1.docx","viewers1\\one-page1.docx",Utils.MYStorage,Utils.MYStorage,null);apiInstance.moveFile(request);System.out.println("Expected response type is Void: 'viewers/one-page1.docx' file moved to 'viewers1/one-page1.docx'.");}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
<?phpinclude(dirname(__DIR__).'\CommonUtils.php');try{$apiInstance=CommonUtils::GetFileApiInstance();$request=newGroupDocs\Viewer\Model\Requests\MoveFileRequest("viewerdocs\\one-page.docx","viewerdocs1\\one-page-copied.docx",CommonUtils::$MyStorage,CommonUtils::$MyStorage);$apiInstance->moveFile($request);echo"Expected response type is Void: 'viewerdocs/one-page.docx' file moved as 'viewerdocs1/one-page-copied.docx'.";}catch(Exception$e){echo"Something went wrong: ",$e->getMessage(),"\n";}?>
"use strict";classViewer_Node_Move_File{staticRun(){varrequest=newgroupdocs_viewer_cloud_1.MoveFileRequest("viewerdocs/one-page1.docx","viewerdocs1/one-page1.docx",myStorage,myStorage);fileApi.moveFile(request).then(function(response){console.log("Expected response type is Void: 'viewerdocs/one-page1.docx' file moved to 'viewerdocs1/one-page1.docx'.");}).catch(function(error){console.log("Error: "+error.message);});}}module.exports=Viewer_Node_Move_File;
# Import modulesimportgroupdocs_viewer_cloudfromCommon_Utilities.UtilsimportCommon_UtilitiesclassViewer_Python_Move_File:@classmethoddefRun(self):# Create instance of the APIapi=Common_Utilities.Get_FileApi_Instance()try:request=groupdocs_viewer_cloud.MoveFileRequest("viewerdocs\\one-page.docx","viewerdocs1\\one-page.docx",Common_Utilities.myStorage,Common_Utilities.myStorage)api.move_file(request)print("Expected response type is Void: 'viewerdocs/one-page.docx' file moved to 'viewerdocs1/one-page.docx'.")exceptgroupdocs_viewer_cloud.ApiExceptionase:print("Exception while calling API: {0}".format(e.message))
# Load the gemrequire'groupdocs_viewer_cloud'require'common_utilities/Utils.rb'classWorking_With_Filesdefself.Viewer_Ruby_Move_File()# Getting instance of the API$api=Common_Utilities.Get_FileApi_Instance()$request=GroupDocsViewerCloud::MoveFileRequest.new("viewerdocs/one-page1.docx","viewerdocs1/one-page1.docx",$myStorage,$myStorage)$response=$api.move_file($request)puts("Expected response type is Void: 'viewerdocs/one-page1.docx' file moved to 'viewerdocs1/one-page1.docx'.")endend
packageexamples.Working_With_Files;importcom.groupdocs.cloud.viewer.api.*;importcom.groupdocs.cloud.viewer.client.ApiException;importcom.groupdocs.cloud.viewer.model.requests.*;importexamples.Utils;publicclassViewer_Android_Move_File{publicstaticvoidmain(String[]args){FileApiapiInstance=newFileApi(Utils.AppSID,Utils.AppKey);try{MoveFileRequestrequest=newMoveFileRequest("viewers\\one-page1.docx","viewers1\\one-page1.docx",Utils.MYStorage,Utils.MYStorage,null);apiInstance.moveFile(request);System.out.println("Expected response type is Void: 'viewers/one-page1.docx' file moved to 'viewers1/one-page1.docx'.");}catch(ApiExceptione){System.err.println("Exception while calling FileApi:");e.printStackTrace();}}}
packagebasicUsageimport("fmt""github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-go-samples/config"viewer"github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-go/models")funcMoveFile(){srcPath:="SampleFiles/sample.docx"destPath:="SampleFiles/moved_sample.docx"moveOpts:=viewer.FileApiMoveFileOpts{SrcStorageName:optional.NewString("YourStorageName"),DestStorageName:optional.NewString("YourStorageName"),}_,err:=config.Client.FileApi.MoveFile(config.Ctx,srcPath,destPath,&moveOpts)iferr!=nil{fmt.Printf("MoveFile error: %v\n",err)return}fmt.Println("File moved successfully")}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.