Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

259
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda