Jump to content

Getting file script question


DJP1986

Recommended Posts

Hello,

 

I was wondering if there is a way to specify in a PHP script meant to get a file to make the user only able to download two files at a time? I have my get file set up, and I want to make it so the script will only grab two files at a time, and the user has to wait until both are finished to download some more.

 

Is it possible to do that with just PHP?

Link to comment
https://forums.phpfreaks.com/topic/98526-getting-file-script-question/
Share on other sites

if you're not providing direct access to the files, i.e. you're using a script to access each file and the actual paths are hidden.. then you can limit the number of downloads within a given timeframe, but as far as verifying that the file download is complete, you would need something more elaborate..

you could if php passed the files to the browser instead of the browser downloading the raw file.

 

Say you have a website with access to folder outside the public domain, eg above the ROOT folder.

 

You could store all your download files into a private folder. This way you will need a program (like php) to convey (re-route) the data to the browser to download.

 

this can be done by sending specific content-type headers to the browser and then fread'ing the file etc.

 

You would need to use some advanced php/mysql to make sure the user with a specific ip-addresses(short-term) or use java/activeX to get Hardware-Id etc to make sure only the specific user can download the files.

 

then deny all others.

 

 

hope this helps,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.