-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#787: expose file_name parameter for copyto and copyto_using_path met…
…hods
- Loading branch information
Showing
6 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Demonstrates how to copy a file within a site | ||
""" | ||
from office365.sharepoint.client_context import ClientContext | ||
from tests import test_team_site_url, test_user_credentials | ||
|
||
ctx = ClientContext(test_team_site_url).with_credentials(test_user_credentials) | ||
|
||
file_from = ctx.web.get_file_by_server_relative_url( | ||
"Shared Documents/Financial Sample.xlsx" | ||
) | ||
folder_to_url = "Shared Documents/archive" | ||
new_filename = "Financial 2023.xlsx" | ||
file_to = file_from.copyto(folder_to_url, True, new_filename).execute_query() | ||
print("File copied into '{0}'".format(file_to.serverRelativeUrl)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters