FLOki
FLOki
CC#
Created by Alex on 10/30/2024 in #help
Upload file with swagger ui crash
Put a debugger in your Program.cs file where you're mapping the contollers and step through. If everything else fails generate a fresh project and move your endpoint there to see what the problem is. What also helps is posting a ling to your repo to see your project setup and configuration
13 replies
CC#
Created by Alex on 10/30/2024 in #help
Upload file with swagger ui crash
Yes. Both Swagger and Postman work when I upload a file
13 replies
CC#
Created by Alex on 10/30/2024 in #help
Upload file with swagger ui crash
Also, why is formFile nullable?
13 replies
CC#
Created by Alex on 10/30/2024 in #help
Upload file with swagger ui crash
What happens if you cut out putObjectArgs entirely?
C#
[HttpPost("upload")]
public async Task<IActionResult> Upload(IFormFile? formFile)
{
if (formFile == null || formFile.Length == 0)
{
return BadRequest("No file uploaded.");
}

return Ok(new { message = "File uploaded to the bucket" });
}
C#
[HttpPost("upload")]
public async Task<IActionResult> Upload(IFormFile? formFile)
{
if (formFile == null || formFile.Length == 0)
{
return BadRequest("No file uploaded.");
}

return Ok(new { message = "File uploaded to the bucket" });
}
13 replies
CC#
Created by Alex on 10/30/2024 in #help
Upload file with swagger ui crash
I'm alwo writing a file upload endpoint. No issues uploading files so far. Feel free to glance at my code and follow the code-review here: https://discord.com/channels/143867839282020352/1300831004411428994
13 replies