pdf download problem - browser

I just want to add a link for pdf file.
But when i click on the link then pdf file open in the browser,
But i want that user prompt for to save or open the pdf file.
Thanks in advance.

If you can add a header in the response from the server:
Content-Disposition: attachment; filename="<your-file-name>"

Related

How to upload powerpoint/word file through postman

My main objective is to upload .pptx/.docx/.pdf file to Microsoft Sharepoint using Microsoft Graph API.
Am able to upload to simple text files using the below "PUT" request, where the content-type is multipart/form-data
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/{simple.txt}:/content
But for .pptx/.docx/.pdf files, although am getting response as "200 ok", but no file is getting creating in sharepoint site document.
I have correctly configured File type with "File" as the key and selected the appropriate file in the value of the body of the request in postman.
Observation -> While uploading txt file, the response is "201 created" and the contents of the uploaded files is getting changed. For example, if the content was "Hello there". The upload file content is,
----------------------------404518839734975569926100
Content-Disposition: form-data; name="File"; filename="sample.txt"
Content-Type: text/plain
Hello there
----------------------------404518839734975569926100--
Can someone explain what's going on here and how to upload pptx/doc/pdf file in sharepoint using MS Graph API's.
You could upload the .docx file using Graph API in post man like this.
PUT drives/{drive-id}/root:/fileName.docx:/content
In Body, choose binary type.

How to catch a download event by export blob document with playwright

My website have a editor page and export button. When i click on export button, page will gather all informations, then generate a pdf file automatically and open in new tab by Chrome Viewver.
The generate link is: blob:https://somecode
I tried to turn off Chrome Viewer and force it download pdf file. However, i cannot catch the download event.
Please guide me how to catch the download file path by Playwright using Nodejs.
Thank you.
You can catch the browser context's "page" event - it's a start, but not the solution, I'm stuck somewhere around that too.

How can i give link to download(not open) pdf file in reactjs

this is my code which i am writing in render method, which works fine, but instead of downloading this file it's opening in browser.
download
How can i give a link in react to force download a file, file which is coming from external server.
HTML5
<a download href="file.pdf">Download PDF</a>
Suppose you have a variable names as "link" in which the link is stored. So you can do,
<a href={`${link}`} type="application/pdf; download='some_pdf_name'>Download</a>

Retrieve signed document using DocuSign API

I want to download a document signed recipient using DocuSign API (REST).
I am using the following endpoint as per the documentation.
HTTP request
GET /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}
Request Headers
X-DocuSign-Authentication:{"Username": <Username>,"Password": <Password>,"IntegratorKey": <IntegratorKey>}
Accept: application/pdf
Content-Transfer-Encoding:base64
I got document in a base64 format which I am able to download but when try to open that file using PDF viewer we got the following message:
The file is blank and some error related to signature, check following screenshot
PDF open error snapshot
Are there any parameters missing while downloading the document? Please help.
Thanks.
See this link for EnvelopeId stamp control
https://support.docusign.com/en/articles/How-do-I-move-the-Envelope-ID-Stamp-on-my-documents
In DEMO environment you will always have the "demonstration only" stamp on the document. This will not be present when you goto prod environment

fail to download jpg file in chrome using https connection

I'm creating a button, that will download a jpg file when you click it. What Im doing is that redirect to a hyperlinking to the img file and setting the content-type and content-disposition headers there using the code below
header('Content-Description: File Transfer');
header('Content-Type: image/jpeg' );
header('Content-Length: ' . filesize($fullpath));
header('Content-Disposition: attachment; filename=' . basename($filename));
readfile($fullpath);
$fullpath is the pysical location of the jpg file
it works fine in chrome IE and firefox in my develop website, which used http connection.
but when I put it the live website, which uses https connection, IE and firefox still works fine, but chrome sometimes works, sometime it will show a page with messed up strings instead of download the jpg file. I think maybe chrome didn't recognize the MIME type of the jpg file and treat it as plain text. This is pretty odd (sometime it could recognize the jpg file and download it, sometime not) . Has anyone got the same problem before or has any idea to fix this?

Resources