Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
How to get file from drive - swagger

So I use swagger and have manage to get link loaded into the system correct. Now I need to get a file from the drive but it seems I cant get it right. Below is both the code for a link and one of my many tries to get a file from a drive.

This is the code

<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script>
     window.onload = function() {

  // Build a system
  const ui = SwaggerUIBundle({
  validatorUrl: null,
  docExpansion: 'none',
  operationsSorter: 'alpha',
   tagsSorter: 'alpha',
   urls: [{url: "C:/web/swagger/swaggerfiles//swagger.json", name: "Something"},
       {url: "http://worksjusstfine/swagger.json", name: "Something else"} ],

dom_id: '#swagger-ui',
deepLinking: true,
presets: [
  SwaggerUIBundle.presets.apis,
  SwaggerUIStandalonePreset
],
plugins: [
  SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
 })

 window.ui = ui
 }
</script>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Swagger expects the file url to be within the project, but the browser does not have access to your file system so you need to create an endpoint to access these files. The easiest solution is to create a JavaScript file to retrieve these files. You can write something like:

app.use('/swagger', express.static('path/to/file'));

Now your browser can access the directory using /swagger. In your urls array, simply use '/swagger/filename' instead of the entire path.

about 4 years ago · Juan Pablo Isaza Report

0

To get this working I had to add a directory in IIS and then point out where the files were on the computer. Then I was able to get a http link.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!