-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to return the URL of an uploaded document #2
Comments
Let me do some testing and I will get back to you.
Thanks
Lu
From: rickmedlin ***@***.***>
Sent: Friday, May 27, 2022 6:49 PM
To: iamlu-coding/python-upload2sharepoint ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [iamlu-coding/python-upload2sharepoint] How to return the URL of an uploaded document (Issue #2)
With office365.runtime, I did it as shown below. How would you suggest doing it with SharePlum?
# Get authorization from the site url.
ctx = ClientContext(siteurl, ctx_auth)
with open(localpath, 'rb') as content_file:
file_content = content_file.read()
dir, name = os.path.split(remotepath)
file = ctx.web.get_folder_by_server_relative_url(dir).upload_file(name, file_content).execute_query()
sourcedoc = '{' + file.properties['UniqueId'] + '}'
fullurl = siteurl + '_layouts/15/Doc.aspx?sourcedoc=' + urllib.parse.quote(sourcedoc)
—
Reply to this email directly, view it on GitHub<#2>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARPONWJMFC52ARENY7TPZ4TVMFURDANCNFSM5XFZYSJQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
I looked at the documentation for SharePlum and came up with this: from shareplum import Site authcookie = Office365('https://mysite.sharepoint.com', username='user', password='password').GetCookies() print(folder.files[0]['LinkingUrl']) This prints out the 'LinkingUrl' attribute, which is exactly what I need to create a link in the PHP page. Now, the question is how to return that value after the upload. |
With office365.runtime, I did it as shown below. How would you suggest doing it with SharePlum?
The text was updated successfully, but these errors were encountered: