Hi @Peter_1985 ,
Thanks for reaching out.
Here are a few practical ways to test it:
1. Test the endpoint directly
The easiest way is to send a test request to your API. You can use tools like Postman, curl, or even your browser's developer tools to send a POST request to https://your-server.com/api/uploadfile with a file attached.
https://learn.microsoft.com/en-us/aspnet/core/test/http-files
If everything's working, you should get back an "Ok" response with your success message. If you send a request without a file, you should get a "BadRequest" response with "File not selected".
2. Check your server's file system
After sending a test file, navigate to the "Uploads" folder on your server (relative to where your application is running) and verify the file actually saved there.
3. Review application logs
Check your application logs for any errors or warnings. ASP.NET Core has built-in logging that can help you spot issues.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/
You can also add some logging to your controller to track when files are being uploaded successfully or when errors occur.
4. Set up health checks (optional but recommended)
For ongoing monitoring, consider implementing health checks in your ASP.NET Core app.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks
This lets you have a dedicated endpoint that reports whether your application is healthy and running.
Quick tip:
Test both scenarios - sending a valid file AND trying without a file - to make sure both your happy path and error handling work as expected.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.