onestoppowerful

  • Home

Application Octet Stream Pdf

Posted By admin On 25/04/19
Application Octet Stream Pdf Average ratng: 9,1/10 8777 reviews

Join GitHub today

File Extensions Associated with application/octet-stream MIME: PKG file extension (3D Image Files). Automise ActionStudio Action Design (VSoft Technologies Pty Ltd.).

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.

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.

Case 2:
It throws 200 - Unknown response type.

Possible Solution

Context

Writing an api to download the PDF content

commented Feb 23, 2018

Stream

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

Application

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

Hello everyone and congratulations for the useful plugin!

I have an issue with the download of a pdf file.
I did several tests, I finally summed up in test3.html file contained in the archive that I have submitted, in attachment (I know it is not very good... I packed the entire test environment, in a file archive, so after this, I changed its name to get it accepted by the site. So you must save it locally and then rename it as zip file! in the extracted dir, you will find all I have used in the test.).
PS. in the fileDownload.js file, I changed the return error function, so to obtain more useful information about the error... but so far still have not managed to solve the problem.
My enviroment is Windows XP (SP3), IE8, FF22, Chrome rel 35.0.1916.114 m.
I tried also the jQuery 1.10.2 (in the dir).

Thank you for your valuable help. If I find a solution before your reply, I'll let you know. Again, thank you.
R.A.


Save and rename to .zip.
SHA1: 1e081701ffb2a8d07eaf9c387514277ec1a5fd4f
MD5: f6fd3fb728c49af918c12ee6a21bf631

  • Recent Posts

    • Hollywood Action Movies Hindi Dubbed
    • Free Game Apps For Tablet
    • Crystal Reports Viewer 11.5 Download
    • Film Wiro Sableng Full Movie
    • Bengali Movies Free Download
    • Autodesk Autocad 2015 Keygen
    • Fonelab For Android Registration Key
    • Bewafa Hai Tu Video
    • All Running Man Episodes
    • Simcity 5 License Key
    • Veer Zara Song
    • Sectia 16 Politie Program
    • Pc Based Automotive Diagnostic Software
    • Xbox 360 Game Torrents Downloads
    • Buku Sekolah Digital Kurikulum 2013
    • Jodha Akbar Hindi Movie
    • Watch Movies 1080p Online Free
    • Lagu Rossa Terbaru
    • Download Game Terbaru Untuk Laptop
    • Thalattu Songs Tamil
    • Brighton Leather Purse Serial Number
    • Pirate Bay Games Pc Download
    • Kof Apk
    • Free Astrology Books Pdf
    • Premiere Pro Cs5 Download Free
    • Translate Bahasa Inggris Ke Bahasa Indonesia
    • Crystal Reports Version 9 Download
  onestoppowerful Copyright © 2019.
Back to Top ↑