PDA

View Full Version : Need some help


Intermezzo
10-16-2006, 09:50 PM
Hi, I'm currently coding a file hoster like rapidshare/Megaupload. OK, I can everything do by myself except the apache-things. Maybe someone has the time to help me in these questions :>

Everything will run under Apache2 + Debian Sarge.

Now, please look at this: http://uploaded.to/?id=79e6b5
When you hit the download button a php site will be called and than the download will start. I would do it this way: call php -> header('Location: filepath'); But that's wrong :( Everyone will than know the real path of the file and maybe will hotlink it. Of course I could write a anti-hotlink htaccess but uploaded.to shows that it works. Here a dump from my network sniffer:

POST /Download.php?id=4b33b2b6cf5c118efeba0699a9cd587f&filename=vlcsnap-179818.jpg HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-icq, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://uploaded.to/?id=79e6b5
Accept-Language: de
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: s19.uploaded.to
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: __utma=28252408.407526962.1154115015.1160998875.1161027959.45; __utmz=28252408.1160965001.35.12.utmccn=(referral)|utmcsr=fastfolder.net|utmcct=/|utmcmd=referral; PHPSESSID=3ef4601b2130bf374d07da9fc863b803; __utmb=28252408; __utmc=28252408

and than the response:

HTTP/1.1 200 OK
Date: Mon, 16 Oct 2006 19:46:06 GMT
Server: Apache/2.0.54 (Linux/SUSE)
X-Powered-By: PHP/4.4.0
Content-Disposition: attachment; filename="vlcsnap-179818.jpg"
Expires: Mon, 16 Oct 2006 21:46:07 GMT
Accept-Ranges: bytes
Cache-control: private
Pragma: private
Content-Length: 14365
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: application/octetstream

..FFmpeg0.4.9-pre1b4756..C.............
.










.........

........................."")............................
............................
.................}........!1A..Qa."q.2.#B.R$3br.
.....%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ................w.......!1..AQ.aq."2..B.#3R.br
.$4%....&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz

and so on....

I really don't believe they doing this by just pipe the data through the php file. That would be too much server load with maybe a file of 250 MB size. Or not?

So do you know any way I can do it?

Thanks and sorry for my bad english :(