I would like to attach a document from SharePoint Online to the mail with the office.js api.
The problem is that the addFileAttachmentAsync method just has an url as parameter so I can currently only attach public available files and not protected files.
In my app I can download the SharePoint file without a custom server as blob or base64.
Is it possible to use the html5 file api or can I reuse the SharePoint token somehow for addFileAttachmentAsync?
Currently there is no way to attach files that are not publicly available.
Related
I try to convert a mail to a PDF in PowerAutomate and save it in SharePoint
I tried different options but the PDF does not open properly in SharePoint (see ErreurPDF screenshots)
The only solution i found was to use One drive to do the PDF conversion (see attachment)
But i would prefer not to use my One drive as it is private and my flow is shared with other users.
Do you have another idea how to convert a mail or at least to create a PDF from PowerAutomate in SharePoint ?
Leveraging OneDrive is the main way, you could create a service account. Then create the flow and use the service account's OneDrive.
Working on windows store apps:
I am trying to access the files and folders of office365 documents library.
I can access the one drive documents as described in this link Common file tasks using the Office 365 client library
But it do not provide a way to access the files and folders in other than onedrive document library.
e.g [https://my-office365-tenant.sharepoint.com/mysite/mydocumentslibrary]
However i had tried a way and it do get the files and folders other than onedrive.
I had not used any capability i created SharePointClient as given below:
var client = new SharePointClient(new Uri("https://my-office365-tenant.sharepoint.com/mysite"),
async () => await AcquireTokenAsync(AuthenticationContext, "https://my-office365-tenant.sharepoint.com"));
IPagedCollection<IItem> items = await client.Files.ExecuteAsync();
In this way i get the files of default "Shared Documents" document library inside "mysite", but i want to get the files and folders of another documents library "mydocumentslibrary" inside same site "mysite".
Can anyone please guide me how to do that or am i missing something? or there is anyother way to do this using office365 api only.
I just went through the documentation of this new API, it seems the file operation is limited to the one drive, I doubt you can get file in another document library.
To get files in other document library, as you're developing windows store APPs, you can SharePoint mobile object model or REST APIs:
Overview of the SharePoint 2013 mobile object model
Get started withthe SharePoint 2013 REST service
The APIs allows access only to default document library. Example:
OneDrive for Business: https://{tenant}-my.sharepoint.com/_api/v1.0/me
SharePoint sites: https://{tenant}.sharepoint.com/{site-path}/_api/v1.0
trying to share a file with external users via the API, our in-house app will upload the file to sharepoint, return the view only link and we can then send that link to external users avoiding emails etc.
Is this possible with .NET C#?
Yes, it is possible. with the SharePoint client object model, your application can: Upload the document to the document list, and set the permission for that item, then return the link to external user.
Can anyone tell me if its possible to get the date an attachment was uploaded on SharePoint?
I know how to get the links for the attachments using GetAttachmentCollection().
Does SharePoint save the date which the file was added on?
Thanks
Yes, SP saves this information but accessing it is not available in SP client API (WS, CSOM). An attachment is exposed as SPFile by the SP server API, it is retrievable by its web-relative URL by GetFile and you would need one of its properties: TimeLastModified.
Seeing the GetAttachmentsCollection, I guess that you are using WS. You could deploy you custom ASMX or WCF WS to your SP farm providing just the upload time for an attachment URL. You could even create your own alternative of the GetAttachmentsCollection method returning all attachment properties you need in addition to the attachment URL. The former option would minimize the code amount you have to write relying on the OOTB functionality as much as possible, the latter one would give you better performance saving the total client-server call count.
If you cannot deploy a farm solution, services returning JSON or XML can be deployed with a sandboxed solution "concealed" as ASPX pages which would allow you to design such application without involving the farm administrator.
I have Sharepoint 2010 hosted with windows authentication . I have created a document library inside a new site and uploaded few files.
Now,I'm trying to utilize the info of these files in some application using Rest Webservice exposed by sharepoint.
*http://{server_name}/{site}/_vti_bin/ListData.svc/{Document_Library_name}*
In the response I get xml containing details of files uploaded in document library. One of the tag in response of xml (inside src attribute of tag) contains detail of url of file uploaded,
Now when I try to use this url for document display/download in my application/browser, it pops up with the window authentication which I have for Sharepoint site . After I provide correct user/password the document gets downloaded.
Is it somehow possible to make this document url public(I don't want window authentication pop up) ? At the same time I don't want to disable the Windows authentication for Sharepoint site .
Thanks in advance
By public do you mean accessible within your LAN or accessible from the internet given the sharepoint site is bound to an internet facing interface? I would imagine on the LAN it would be best to simply use the guest account for users who you wanted to give 'public' access to.
Bear in mind the only reason you're prompted for login details is probably because you're not using Internet Explorer.