In the Office.js plugin, I am looking for a particular inbox message that should be downloaded as a message file (.msg, .eml or other). So, next time I can open that downloaded file without logging in.
How can I do this in Office.js with the Graph API?
Please try to use makeEwsRequestAsync to send request.
Related
1) I am currently downloading pdf of web-page using function window.print()
2)but now i want to send that downloaded pdf in email as a attachment.
3)I am not able to access that pdf in my code
how i will be able to send that email with pdf in just one click?
You can try get a screenshot of your window then put it on a pdf.
see this two plugins
http://html2canvas.hertzen.com
https://parall.ax/products/jspdf
I'm developing an web application right now.
What I have so far in the app is this:
<input type="text" id="textToSendToMyGoogleDrive"/>
<button id="upload file to google drive"> Send </button>
This application has a domain, so every one can go to this application from their computer.
What I want to do is when any user put text in the input, and clicks the button, it will make a txt file and send it into my google drive account.
So I have two problems here:
How to take the text and make from it a txt file.
Send the file to specific google drive account.
Problem number 2 is a problem because I have looked every where in the google drive API, and all I could found is some methods to upload files to the user's google drive, and not to mine. So I tried to search out how to "sign in" the user when he is in the application to my google drive, and I could not find a solution.
If I was not clear on the problems, comment me.
Thank you!
I'am not a expert but correct me if I'am wrong. I think there is a problem with your approach. how about sending your text content as a request parameter to the backend and save it as a .txt from there.
I am suggesting this because,
let say you save your file with text content in users computer as described in here.
next step would be to access it from the browser and save it in the google drive. if you planning to do it from the front end without a backend, you have to expose your google credentials to every user.
Before that you wont be able to access a local file from users computer directly from the browser. because most browsers wont allow you to do that. so please change your approach to this.
How can I save api request response directly to google drive ?
Example :
If I pull a csv report from a reporting API, now I need the file to be directly downloaded into my google drive instead of getting downloaded locally onto my system.
You can use the Save to Drive Button.
The Save to Drive button enables your web site to allow users to save
files to their Drive account from an arbitrary URL via their browser.
The button is configured with a few attributes in a div tag in the
HTML markup, similar to how the +1 button is created.
Snippet of code from the documentation:
The simplest way to display a Save to Drive button on your page is to
include the necessary JavaScript resource and to add the Save to Drive
button tag:
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-savetodrive"
data-src="//example.com/path/to/myfile.pdf"
data-filename="My Statement.pdf"
data-sitename="My Company Name">
</div>
This is how it works:
The technology used to upload files is similar to that used by the
Google Drive web user interface. The file is downloaded to the user's
browser in parts and uploaded to Google Drive as data is received.
This allows the user to save files that require some form of HTTP
authentication because the download is made in the context of the
user's browser.
If the user navigates away from the page before the download is
complete, the data is discarded and no file is created.
I have a web application(PHP) running on a server which hosts several DOCX Documents (MS Word documents)
I want the user (using my application) after choosing any document to be able to:
open the document using Microsoft Word installed on his PC
View the document and edit it.
save his work, and changes must be committed to the server.
could anyone help me how to do that
ie.
lunch MS Word on client PC from JavaScript
know when the user closes the MS Word application on his PC
is it necessary to download the file before editing it or I can edit it remotely?
Thanks in advance
You can launch Office applications using Office URI Schemes. This would allow you to automatically open the file.
If you want to avoid downloading the file locally, you'll need to implement either WOPI or WebDav on your backend to handle the requests.
A simpler solution would be to use Microsoft Graph to push the file into OneDrive. Files in OneDrive have a WebUrl property which wires up opening documents in Office for you.
Yes. I know most developers avoid this because the browser does not allow such hidden downloads, and ask the user if and where to save the file (Known web security issue).
And also I could not know when the download is over.
But
If my client realy insist that he will be able to click once on a web page an have an outlook window open and filled,containing an attachment. can I do so using my own customized browser?
Using a customized browser, yes. (If your client runs windows and has office installed...)
For example, create a .Net winform-program with a IE-browser-control in it.
Add hook to IE-control to get when user clicks a specific a-link.
Then perform a download of file from winform-program, use office-api/automation/3rdpart-control from winform-program to fire up a new mail and add attachment to the mail.
There is no way you can push a server side existent file into a local email window as attachment. It is not sure your client machine runs windows or has MS Outlook at all.
there are mailto link specifications to have urls made in a way that most of the Email clients will receive certain commands from the browser and act accordingly, for example as you can see here: Mailto Parameters Test try the link in the page and you will get a new email window in your default Email Client with To, CC, BCC, Body and subject prefilled.
There is nothing else you can do because you cannot embed file streams in such mailto url.