PHP-Upload Script

All about creating websites!
Post Reply
User avatar
_Sonic_
suck-o-fied!
suck-o-fied!
Posts: 56
Joined: 16 Nov 2006, 17:00
17
Contact:

PHP-Upload Script

Post by _Sonic_ »

Hey guys im searching for a good Upload Script jus for Pictures. Does anyone knows 1 ?

Thanks :D

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hm, just a script? any upload script would work, you only would have to limit the file endings that can be uploaded.....but if you look for something complete take a look at coppermine:
http://coppermine-gallery.net/

:wink:

rhysh
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 767
Joined: 15 Nov 2006, 17:00
17
Contact:

Post by rhysh »

coppermine has alot of rfi vulns though,so if you know php then and know how rfi works then you should be able to patch it up,but by the sounds of it,you dont know php,so i would get some patches for copper mine

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

well, patching is a must anyway, no matter what platform you use. the reason why it looks like there are more vulnerabilities than for other platforms is simply the fact that Coppermine is most likely the most used one... :wink:

User avatar
_Sonic_
suck-o-fied!
suck-o-fied!
Posts: 56
Joined: 16 Nov 2006, 17:00
17
Contact:

Post by _Sonic_ »

copperminse isnt my thing.i need a normal upload script php or html for my new page www.sweet-host.de

can b simple though

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

Simple?

Here ya go.
There's a script readily available, just edit it a little bit. You can at least do that, right?
¯\_(ツ)_/¯ It works on my machine...

User avatar
seer
Newbie
Newbie
Posts: 3
Joined: 21 Feb 2008, 17:00
16
Location: Beijing
Contact:

Post by seer »

I used to check whether the file contains "<?" after uploaded,better for small files:

function checkUploadFile($fileName)
{
$fp = fopen($fileName, "rb");
if(!$fp)
return FALSE;

$header = fread($fp, 16);
$allowed = TRUE;

if(stripos($header, "<?") !== FALSE)
$allowed = FALSE;

$content = $header;
if($allowed)
{
do {
$header = substr($content, -3);

$content = fread($fp, 1024);
$content = $header.$content;
if(stripos($content, "<?") !== FALSE)
{
$allowed = FALSE;
break;
}
} while(!feof($fp));
}

fclose($fp);

return $allowed;
}

Post Reply