|
cyclops4real
|
dear webmaster i got 2 questions
1 am building a game site for downloading and i want a count download on a file clicked before it can be downloaded 2 do i save the downloaded files in a folder or database
hope 2 read your replys
|
|
|
|
|
|
*dhtml
|
i have a free script i developed that you can use. Besides there are lots of them scripts all over the web. I think the problem is that, you dont know how to set it up iight?
|
|
|
|
|
|
cyclops4real
|
I found a java script already it works How download files do i save them in a database or folder
|
|
|
|
|
|
|
|
kehers (m)
|
Q 1. To achieve this you will need to create a download processor script - I mean a script that handles the content, does the counting (probably by incremementing a count field stored in a db with the filename or file id as key) and sending the content to the user. This is coz normal linking to the file like this: http://mysite.com/file.ext wont work for d count. A simple analogy to the download processor script (in PHP) is this: //mysite.com/download.php?fileid=someID //Get the original file, mime type and source from where-ever its stored (db for ex) using fileid GET field if (is_file($path_to_content)) { header("Content-Type: ".$mime_type); header("Content-Length: ".filesize($path_to_content)); readfile($path_to_content); //Do your count here by setting the db count field for this file to + 1 } else { // some error, }
By the way, why do u want to count before downloading? Why not after? If you also have an intermediate knowledge of PHP (and you are scripting wit it), check out the PEAR Package: HTTP_Download ( http://pear.php.net/package/HTTP_Download) Q 2. Save in a secured folder (as suggested by Cactus as well). DB storage is more resource consuming.
|
|
|
|
|
|
*dhtml
|
That pear package may be difficult for you to use if you are not used to php pear. But, though i wrote a script earlier on that processes download, masking and counting on my website - www.mwebng.net - but due to some minor bugs, i used http://www.zubrag.com/scripts/download.phpand later pimped it, but try it out first and if u have any bug, let me know
|
|
|
|
|
|
webdezzi (m)
|
Q 1. To achieve this you will need to create a download processor script - I mean a script that handles the content, does the counting (probably by incremementing a count field stored in a db with the filename or file id as key) and sending the content to the user. This is coz normal linking to the file like this: http://mysite.com/file.ext wont work for d count. A simple analogy to the download processor script (in PHP) is this:By the way, why do u want to count before downloading? Why not after? If you also have an intermediate knowledge of PHP (and you are scripting wit it), check out the PEAR Package: HTTP_Download ( http://pear.php.net/package/HTTP_Download) Q 2. Save in a secured folder (as suggested by Cactus as well). DB storage is more resource consuming.  wasere men! @kehers, aside php, what other language do you use?
|
|
|
|
|
|
kehers (m)
|
@webdezzi I use PHP solely for server side web development. I do J2ME for mobile development though.
|
|
|
|
|
|
webdezzi (m)
|
Can u drop it number pls
|
|
|
|
|
|
don jayzi (m)
|
i was tryin to learn that j2me one time like that, but mehn, i had to escape! i suspect i was not exposed to oop then.
|
|
|
|
|
|
cyclops4real
|
Ok thanks 4 d reply thats d last of my agenda on my list d saving of files will check it out on web thanks
|
|
|
|
|
|
kehers (m)
|
@webdezzi Sorry for d late reply. Here: 08066887840
|
|
|
|
|
|
cyclops4real
|
thanks for the reply i cant seem to find a toturial on linking file path to database you said save files to folder and file path to database i need a little help on dat thanks
|
|
|
|
|
|