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

310
Vistas
How do I pass the server ip address in the form parameter correctly?

I have an application written in fastapi and deployed on the ubuntu server using uvicorn and supervisor. The command uvicorn main:app --host 0.0.0.0 --port 8000 starts the application. And I have access to the application at the address

myserver_ip:8000

The application has a form that (GET) is displayed at

http://myserver_ip:8000/file/



@router.get("/file/")
async def file_receive():
    content = """
<body>
<form action = "http://0.0.0.0:8000/image/uploadfile/" enctype="multipart/form-data" method="post">
<input name="file" type="file" multiple>
<input type="submit">
</form>
</body>
    """
    return HTMLResponse(content=content)

The action parameter is http://0.0.0.0:8000/image/uploadfile/ but after the form redirect, I don't go to the page http://myserver_ip:8000/image/uploadfile/. The same result if I set action = http://localhost:8000/image/uploadfile/

of course, if I set the action variable directly = http://myserver_ip:8000/image/uploadfile/ all everything starts to work. But then there is no way to run this code on a local machine. How do I set redirect correctly?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Why dont you use a relative url?

over 4 years ago · Santiago Trujillo 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