Download A File

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 23, 2009, 02:38 PM
431300 members and 298347 Topics
Latest Member: Tilespace
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: OmniPotens, yawa-ti-de)  |  Download A File
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Download A File  (Read 177 views)
cyclops4real
Download A File
« on: August 16, 2009, 02:59 PM »

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
Re: Download A File
« #1 on: August 17, 2009, 05:00 AM »

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
Re: Download A File
« #2 on: August 21, 2009, 07:07 AM »

I found a java script already it works
How download files do i save them in a database or folder
Cactus (m)
Re: Download A File
« #3 on: August 21, 2009, 07:27 AM »

save the files in a secured folder and save the links to the folder in the db.

you can also include a script that masks the url and generates a random number of characters to replace the url,  eg

instead of = http://www.mysite.com/foldname/filetodownload.zip

then you will have = http://www.mysite.com/i4m1337fml

kehers (m)
Re: Download A File
« #4 on: August 22, 2009, 02:01 AM »

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:
Quote
//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
Re: Download A File
« #5 on: August 22, 2009, 10:32 AM »

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.php
and later pimped it, but try it out first and if u have any bug, let me know
webdezzi (m)
Re: Download A File
« #6 on: August 22, 2009, 03:06 PM »

Quote from: kehers on August 22, 2009, 02:01 AM
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.


 Wink Wink Wink Wink Wink Wink Wink Wink wasere men!
@kehers, aside php, what other language do you use?
kehers (m)
Re: Download A File
« #7 on: August 23, 2009, 01:26 AM »

@webdezzi
I use PHP solely for server side web development. I do J2ME for mobile development though.
webdezzi (m)
Re: Download A File
« #8 on: August 23, 2009, 05:10 PM »

Can u drop it number pls
don jayzi (m)
Re: Download A File
« #9 on: August 23, 2009, 07:26 PM »

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
Re: Download A File
« #10 on: August 25, 2009, 06:39 AM »

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)
Re: Download A File
« #11 on: August 25, 2009, 01:00 PM »

@webdezzi
Sorry for d late reply. Here: 08066887840
cyclops4real
Re: Download A File
« #12 on: August 26, 2009, 02:19 PM »

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
 Help Ooooooooooooooooo  Help With Saving Adsense Code On My Website  Lamandapit  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.