My Tus URL for .Net Core 3.1 is not working, is my configuration correct?

577 views Asked by At

When I send a request to the URL path specified in the Startup class I am getting 404 not found when using a Post request, I am using Postman. When I send a options request with Postman, I hit the block of code in the Startup class and get 204 No Content.

What am I doing wrong here? I have went to the .NET example of tus and watch their network request via chrome dev tools, my request seems to be identical?! I am using .NET core 3.1.

Startup class, Configure method.

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        app.UseCors(builder => builder
           .AllowAnyHeader()
           .AllowAnyMethod()
           .AllowAnyOrigin()
           .WithExposedHeaders(tusdotnet.Helpers.CorsHelper.GetExposedHeaders())
        );

        app.UseTus(httpContext => new DefaultTusConfiguration
        {
            // c:\tusfiles is where to store files
            Store = new TusDiskStore(@"C:\tusfiles\"),
            // On what url should we listen for uploads?
            UrlPath = "/files",
            Events = new Events
            {
                OnFileCompleteAsync = async eventContext =>
                {
                    ITusFile file = await eventContext.GetFileAsync();
                    Console.WriteLine(file);
                }
            }
        });
    }

image of my Postman request

1

There are 1 answers

0
RussBuss On

So it appears that you are unable to make this type of request via Postman. I was able to get it working when I pulled down and used there js client lib.