Application Octet Stream Pdf

Application Octet Stream Pdf Average ratng: 4,9/5 2620 reviews
Application Octet Stream Pdf

Join GitHub today

Cara Membuka File Format.octet-stream dan mengkonvertnya menjadi format PDF Abdi Syahputra Harahap Pada April 10, 2017 tutorial ABDIUSU - Mungkin dari kita lagi. Lalu kita buka file yang berformat.octet-stream dengan menggunakan browser tersebut. Dec 10, 2018. Application/xhtml+xml, application/xml, application/pdf. Avoid using application/octet-stream as most browsers do not allow defining a. By default, many web servers are configured to report a MIME type of text/plain or application/octet-stream for unknown content types. As new content.

GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.

Sign up 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.

Application/octet-stream Pdf Java

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

Comments

commented Feb 23, 2018

QA
Bug or feature request?Bug
Which Swagger/OpenAPI version?
Which Swagger-UI version?3.X
How did you install Swagger-UI?
Which browser & version?Chrome
Which operating system?Windows

Demonstration API definition

Case 1:
responses:
'200':
description: '.
content:
application/pdf:
schema:
type: string
format: binary

Case 2:
responses:
'200':
description: '.
content:
application/octet-stream:
schema:
type: string
format: binary

Configuration (browser query string, constructor, config.yaml)

Case1:
curl -X GET 'http://localhost:8080/rest/*****true' -H 'accept: application/pdf'

Case2:
curl -X GET 'http://localhost:8080/rest/*****true' -H 'accept: application/octet-stream'

Expected Behavior

It should either display the PDF content in the browser or it should provide link to download the file.
And with the same curl command returns the download prompt for pdf file, while trying in postman tool.

Current Behavior

Case 1:
It throws Not acceptable error - 406.

Fast and furious 7 full movie. Case 2:
It throws 200 - Unknown response type.

Possible Solution

Context

Writing an api to download the PDF content

commented Feb 23, 2018

You haven't specified which version of swagger-ui.

Also, in this case, without a live server for us to test against, it would be difficult to reproduce.

commented Feb 27, 2018

@balaji-tech87 your example works fine for me using Swagger UI 3.11.0 and PDFs on GitHub. The response section displays the 'Download file' link.

The issue is likely with your server.


commented Feb 27, 2018

Hi @balaji-tech87!

I ran @hkosova's example through a web proxy that modified GitHub's Content-Type: application/octet-stream to be Content-Type: application/pdf, and I was able to reproduce the Unknown response type error.

It should either display the PDF content in the browser or it should provide link to download the file.

Swagger-UI does not support inline viewing of PDFs, nor do I expect it to do so in the future. PDF rendering is not easy to do consistently in a web application, and even then it requires heavy libraries.

Swagger-UI does allow for file downloading, as you know - however you'd need to either send Content-Type: application/octet-stream or Content-Disposition: attachment; to indicate that your response body should be downloaded by the user agent.

Learn more about Content-Dispositionhere.

commented Feb 28, 2018

Hi Team,
Thanks for your quick suggestions by reproducing the issue.
I also have tried by setting Content-Type: application/octet-stream and with Content-Disposition: attachment. The pdf link is enabled and it gets downloaded by clicking it.
And thanks for confirming, Swagger-UI doesnot support inline viewing of PDF.

Suggestions:
If possible, please update the spec that 'application/octet-stream' needs to used instead of 'application/pdf'.
Spec Link : https://swagger.io/docs/specification/describing-responses/
Under section : Response That Returns a File

commented Mar 1, 2018

Thanks. Closing the ticket. I will raise new ticket, if any further clarification required. Thanks for your support.

referenced this issue Feb 25, 2019

Closed

5.0.0-beta Download File does not work #1034

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment