Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

260
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda