Pregunta

I have written a little PHP script, which limits the speed when downloading a file and which supports download resuming feature.

But the speed limit can be overrided by using download managers, which create for example 10 download sections and therefore download 10 other parts of the file at same time and reach by this method a 10 times faster speed.

I would like to know, how can i find out, that a specified user is already running a download and which HTTP status Code i need to send out in order to make Download Managers know, that they are not allowed to download other parts of the file at same time, but that download resuming feature is allowed?

EDIT: Maybe it wasn precise enough... I need actually the best HTTP status code to let downloadmanagers know, that multiple filestreams (or sections) of the same file are not allowed, but just only one.

¿Fue útil?

Solución

You could restrict the download to one connection per IP, then send a 429 Too Many Requests HTTP code (or just 403 Forbidden) to subsequent requests.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top