John Kenedy
John Kenedy

Reputation: 574

C# ASP.NET File Serving Resume and Section

I have files to serve. When user click the file how to generate a random URL that valid only 15 minutes, and when download start, the file can support multiple section and support resume. I thought there must be some mathematics involved, do you have any idea how this can be done?

Also for free user, I will make the link to not able for resume and only 1 section, how to do that?

Upvotes: 0

Views: 408

Answers (1)

Lloyd
Lloyd

Reputation: 29668

You need to generate a GUID or somesuch and store it in a database/session with the time generated. You can then pass the GUID in the URL and validate the time started with the time now. >15 is invalid.

As to sections and resume, this is not a thing for your server, this is a client thing, all your server needs to do is support byte ranges through HTTP.

Upvotes: 2

Related Questions