Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / PHP File downloader

Author
Message
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 17:44
Hi all. I need some help with downloading a file in php.

here's my code:

soldownloaderform.php:



soldownloader.php:



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
heyufool1
16
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 30th Jan 2011 17:49
PHP looks like an ugly language

"So hold your head up high and know, it's not the end of the road"
Impulse Game Engine
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 18:00
It is. lol. But I need some help on this.

I greatly appreciate it everyone!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 30th Jan 2011 18:07 Edited at: 30th Jan 2011 18:08
Quote: "PHP looks like an ugly language"

Take that back! lol

It's only looks ugly because he doesn't have a proper structure in his code.

Now back on topic :

Quote: "// Extract the type of file which will be sent to the browser as a

header"

This is wrong for obvious reasons ... "browser as a" has to be on the same row as the // or it's not treated like a comment.

Quote: "// Modify this line to indicate the location of the files you want

people to be able to download

// This path must not contain a trailing slash. ie.

/temp/files/download"

Same thing here.If the script is giving you a parse error,this is probably the problem.

Quote: "\"".$_POST['filename']."\"

There's no need for this crap.When the echo (die) uses double quotes you could just use



Quote: "$file = "$download_path$file";"

You're better off changing it to :



I don't really like your coding style,It's very unorganized,but maybe that's just me.

One thing I want to know , what exactly is the problem?

Parse error?
The script not doing exactly what you want?


PC Specs:Windows 7 Ultimate 64-bit,Intel Core i7 960 @ 3.20GHz,NVIDIA GeForce GTX 480,12GB RAM,2x Western Digital 997GB HDD
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 18:37
It can't find the file. But I do know the file is on my server.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 30th Jan 2011 18:48
I did a few simple fixes to make sure it doesn't give parser errors. It works on my server...

Try this :




PC Specs:Windows 7 Ultimate 64-bit,Intel Core i7 960 @ 3.20GHz,NVIDIA GeForce GTX 480,12GB RAM,2x Western Digital 997GB HDD
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 18:55
It has to download the file with an http link.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 30th Jan 2011 19:11
If the file is on the same server as the script,it would be pretty pointless to use http:// ...

If you are trying to leech off some websites content,best give up now,because these are local functions and unless the website has opened access for external scripts,you can't brute force a download.

You need fsockopen() and the server must have an open socket.


PC Specs:Windows 7 Ultimate 64-bit,Intel Core i7 960 @ 3.20GHz,NVIDIA GeForce GTX 480,12GB RAM,2x Western Digital 997GB HDD
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 19:35
i simply want to download a file.

there's a file at http://sephiroth.it/python/solreader.php that i need called solreader.php

they give u the solreader.phps but not dot php.

I need that file so i can decode this sol file i have.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 30th Jan 2011 19:44
Oh god...

The .phps file is the source , a.k.a solreader.php , but the extension is changed so that you can actually download it , instead of the server treating it as an executable script , a.k.a .php ...

Open the .phps with notepad and re-save it as .php

That is unless I misunderstood you...


PC Specs:Windows 7 Ultimate 64-bit,Intel Core i7 960 @ 3.20GHz,NVIDIA GeForce GTX 480,12GB RAM,2x Western Digital 997GB HDD
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 19:50
u know the page solreader.php where it has the file browse thing then it says send query?
i need the actual submit page.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 30th Jan 2011 22:52
If you're trying to download it from another site, just give up, why waste your time trying?

Login to post a reply

Server time is: 2025-05-22 11:33:26
Your offset time is: 2025-05-22 11:33:26