| 11:58 am on Feb 19, 2008 (gmt 0)|
if you are uploading the file to your server then you don't need to upload the full file to the mysql database. you just need to mention its link in the mysql table e.g
you download backup1.zip in /uploads/ then in mysql table where you store the upload information you can store its name like /uploads/backup1.zip
then just link it in your pages for downloading.
there are different issues which you may be considering e.g how to hide the actual download link so that people cannot hotlink your files or get the uploads directory path.. you can do it with php easily then by composing the download link and using HEADER() to redirect to the file or some other similar trick.
| 6:40 pm on Feb 19, 2008 (gmt 0)|
Yeh I want to have the file thing like microsoft has, you just get the file without knowing the path to all the downloads, is there any way I can do that?
| 8:48 pm on Feb 19, 2008 (gmt 0)|
you would use a downloader script
the link would look something like
where 12345 is the id from the row in mysql
the script would get the path and all info about the file from the db by using the id passed in $_GET
then it puts together the headers and forces the download
| 9:12 pm on Feb 19, 2008 (gmt 0)|
Ok cool thanks, I'm not sure on how to like make it a new ID by itself everytime I put a new row in the database. Like how would I make it do it by itself?
| 1:00 am on Feb 20, 2008 (gmt 0)|
have your id column set to auto increment, this will ensure that it is unique
it will increment each time by itself if you just use an empty set of quotes on INSERT
| 3:00 am on Feb 20, 2008 (gmt 0)|
Alright yeh I just figured it out.
| 5:20 am on Feb 20, 2008 (gmt 0)|
You can also generate a one-time temporary download links for people, if you email the link for downloading rather than offering on-the-fly downloading.
For that you might use generate a timestamp based unique number for the user and store it in a download-queue table. email the link,as jatar_k told you. When the visitor visits the link, check if the unique number embedded in the link exisits, if it does then send the visitor to the download page and remove the unique number / download request number from the table.
if the number doesn't exist simply show the requist expires or wrong request number error.
| 5:43 am on Feb 20, 2008 (gmt 0)|
How would I like display the page, like jatar_k said. Like if I had the id, how would I do download.php?id=1 or whatever.
| 6:04 am on Feb 20, 2008 (gmt 0)|
OMG! you got to learn basic php-mysql concepts...
make a download.php page that displays nothing... connect to mysql, select downloadlink from table where id=$_REQUEST['id'] and header() ...
| 6:13 am on Feb 20, 2008 (gmt 0)|
doh! yeh imma dummy lol I just know like little about forms and like emailing forms, thats about all I can do by myself. Ive been trying to learn this stuff on php.net and stuff but its confusing to me. sorry =[
btw whats the downloadlink thing you said?
| 6:14 am on Feb 20, 2008 (gmt 0)|
ohh nvm I see.
what do I put as the header and stuff, I keep seeing stuff about header() but idk what it is.
| 6:51 am on Feb 20, 2008 (gmt 0)|
www.w3schools.com is a very good place to start learning php. Also google php-mysql tutorial and you will get a website with very similar name, follow that...
You will face lots of problems if your base is not firm and you are completing tasks with quick helps.. so I will strongly suggest you firming your base by learning php properly.
this is how it works
| 8:07 am on Feb 20, 2008 (gmt 0)|
Ok thanks I got it to work. Now I googled and looked in on how to hide the actual url, but I'm still not sure on how to do that.