Log in

View Full Version : how do i do my uploader



Jaymai
11-03-2007, 07:41 PM
I got the script, but how does it upload the images it just says error mysql or something how i get it to say [IMGwww.blahblahIMG]

Thanks

LondonGoons
11-03-2007, 07:59 PM
i don't no if im correct but did you setup the mysql up? like a new one just for the uploader

Jaymai
11-03-2007, 08:00 PM
Sorry, im sort of new, how do i do that

LondonGoons
11-03-2007, 08:12 PM
When you downloaded the upload read the readme file, or post it here..

Jaymai
11-03-2007, 08:18 PM
EasyImageHoster 1.32

©2006 by TPAX



1. Open up and edit config.php

2. Upload the content of the folder on your webspace

3. Make sure your 'images' and 'thumbs' dir chmod is set to writeable (chmod 777 or 755)

4. Done :)





Any problems?

Contact me: removed btw

LondonGoons
11-03-2007, 08:20 PM
Did you edit the config.php

did you chmod your images and thumbs to 777

?

Jaymai
11-03-2007, 08:22 PM
If i give you link to upload it and give cpanel details could you do for me?

LondonGoons
11-03-2007, 08:24 PM
i could try, PM me.

TFerg006
11-03-2007, 08:24 PM
goto cPanel > MySQL > Add new Database > Name it w.e you want > Make a MySQL User > Name it w.e you want > In the MySQL Bit in cPanel give ALL access grants to The user for that database

Edit the config.php file (or something like that) that came with the uploader.

Drompo
11-03-2007, 08:24 PM
<?
// Script Made By Ashley Cusack
// CONFIG
$serverpath = "upload/"; // Path to where images should be upload the server.
$urltoimages = "http://youngfm.co.uk/uploader/upload"; // Web address to where the images are accessible from.
$maxsize = "500000"; // Example - 20000 is the same as 20kb
$uniq = uniqid("");
// CONFIG END

$mode = $_GET['mode'];
if ($mode == "") { $mode = "form"; }

if ($mode == "form") {
echo "<form enctype='multipart/form-data' method='post' action='?mode=upload'>\n";
echo "Upload file: <input type='file' name='file'>\n";
echo "<br><input type='submit' name='Submit' value='Upload'>\n";
echo "<br>Maximum File Size: $maxsizeb Bytes";
echo "<br>$file";
}

if ($mode == "upload") {
$file = $_FILES['file']['name'];
$name = time() . substr($file, -4);
// If you add your own file types don't forget to add an uppercase version.
$allowedfiles[] = "gif";
$allowedfiles[] = "jpg";
$allowedfiles[] = "jpeg";
$allowedfiles[] = "jfef";
$allowedfiles[] = "jpe";
$allowedfiles[] = "png";
$allowedfiles[] = "GIF";
$allowedfiles[] = "JPG";
$allowedfiles[] = "JPEG";
$allowedfiles[] = "JFEF";
$allowedfiles[] = "JPE";
$allowedfiles[] = "PNG";
$allowedfiles[] = "PDF";
$allowedfiles[] = "pdf";
$allowedfiles[] = "PSD";
$allowedfiles[] = "psd";
$allowedfiles[] = "bmp";
$allowedfiles[] = "BMP";
$allowedfiles[] = "tif";
$allowedfiles[] = "tiff";
$allowedfiles[] = "TIF";
$allowedfiles[] = "TIFF";
$allowedfiles[] = "dib";
$allowedfiles[] = "DIB";


if($_FILES['file']['size'] > $maxsize)
{
print "File size is too big - please reduce file size and try again.";
}
else {
$path = "$serverpath/" . $name;
foreach($allowedfiles as $allowedfile) {

if ($done <> "yes") {
if (file_exists($path)) {
echo "A file with this name already exists - please rename the file and reupload.";
exit;
}
}

if (substr($file, -3) == $allowedfile) {
move_uploaded_file($_FILES['file']['tmp_name'], "$path");
$done = "yes";
echo "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
echo "<p><img src='$urltoimages/$name' border='0'>";
echo "<p>Direct Link: <input name='direct' type='text' size='75' value='$urltoimages/$name'></a></p>";

}

}

if ($done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
}
}

?>

I made that, feel free to edit it

TFerg006
11-03-2007, 08:25 PM
<?
// Script Made By Ashley Cusack
// CONFIG
$serverpath = "upload/"; // Path to where images should be upload the server.
$urltoimages = "http://youngfm.co.uk/uploader/upload"; // Web address to where the images are accessible from.
$maxsize = "500000"; // Example - 20000 is the same as 20kb
$uniq = uniqid("");
// CONFIG END

$mode = $_GET['mode'];
if ($mode == "") { $mode = "form"; }

if ($mode == "form") {
echo "<form enctype='multipart/form-data' method='post' action='?mode=upload'>\n";
echo "Upload file: <input type='file' name='file'>\n";
echo "<br><input type='submit' name='Submit' value='Upload'>\n";
echo "<br>Maximum File Size: $maxsizeb Bytes";
echo "<br>$file";
}

if ($mode == "upload") {
$file = $_FILES['file']['name'];
$name = time() . substr($file, -4);
// If you add your own file types don't forget to add an uppercase version.
$allowedfiles[] = "gif";
$allowedfiles[] = "jpg";
$allowedfiles[] = "jpeg";
$allowedfiles[] = "jfef";
$allowedfiles[] = "jpe";
$allowedfiles[] = "png";
$allowedfiles[] = "GIF";
$allowedfiles[] = "JPG";
$allowedfiles[] = "JPEG";
$allowedfiles[] = "JFEF";
$allowedfiles[] = "JPE";
$allowedfiles[] = "PNG";
$allowedfiles[] = "PDF";
$allowedfiles[] = "pdf";
$allowedfiles[] = "PSD";
$allowedfiles[] = "psd";
$allowedfiles[] = "bmp";
$allowedfiles[] = "BMP";
$allowedfiles[] = "tif";
$allowedfiles[] = "tiff";
$allowedfiles[] = "TIF";
$allowedfiles[] = "TIFF";
$allowedfiles[] = "dib";
$allowedfiles[] = "DIB";


if($_FILES['file']['size'] > $maxsize)
{
print "File size is too big - please reduce file size and try again.";
}
else {
$path = "$serverpath/" . $name;
foreach($allowedfiles as $allowedfile) {

if ($done <> "yes") {
if (file_exists($path)) {
echo "A file with this name already exists - please rename the file and reupload.";
exit;
}
}

if (substr($file, -3) == $allowedfile) {
move_uploaded_file($_FILES['file']['tmp_name'], "$path");
$done = "yes";
echo "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
echo "<p><img src='$urltoimages/$name' border='0'>";
echo "<p>Direct Link: <input name='direct' type='text' size='75' value='$urltoimages/$name'></a></p>";

}

}

if ($done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
}
}

?> I made that, feel free to edit it

*STEALS AND CALLS OWN* Jokes xD

Yeh try that, im about to see what its like ;)

letisix
11-03-2007, 08:27 PM
Tferg tell me if it works.

timROGERS
11-03-2007, 08:29 PM
<?
// Script Made By Ashley Cusack
// CONFIG
$serverpath = "upload/"; // Path to where images should be upload the server.
$urltoimages = "http://youngfm.co.uk/uploader/upload"; // Web address to where the images are accessible from.
$maxsize = "500000"; // Example - 20000 is the same as 20kb
$uniq = uniqid("");
// CONFIG END

$mode = $_GET['mode'];
if ($mode == "") { $mode = "form"; }

if ($mode == "form") {
echo "<form enctype='multipart/form-data' method='post' action='?mode=upload'>\n";
echo "Upload file: <input type='file' name='file'>\n";
echo "<br><input type='submit' name='Submit' value='Upload'>\n";
echo "<br>Maximum File Size: $maxsizeb Bytes";
echo "<br>$file";
}

if ($mode == "upload") {
$file = $_FILES['file']['name'];
$name = time() . substr($file, -4);
// If you add your own file types don't forget to add an uppercase version.
$allowedfiles[] = "gif";
$allowedfiles[] = "jpg";
$allowedfiles[] = "jpeg";
$allowedfiles[] = "jfef";
$allowedfiles[] = "jpe";
$allowedfiles[] = "png";
$allowedfiles[] = "GIF";
$allowedfiles[] = "JPG";
$allowedfiles[] = "JPEG";
$allowedfiles[] = "JFEF";
$allowedfiles[] = "JPE";
$allowedfiles[] = "PNG";
$allowedfiles[] = "PDF";
$allowedfiles[] = "pdf";
$allowedfiles[] = "PSD";
$allowedfiles[] = "psd";
$allowedfiles[] = "bmp";
$allowedfiles[] = "BMP";
$allowedfiles[] = "tif";
$allowedfiles[] = "tiff";
$allowedfiles[] = "TIF";
$allowedfiles[] = "TIFF";
$allowedfiles[] = "dib";
$allowedfiles[] = "DIB";


if($_FILES['file']['size'] > $maxsize)
{
print "File size is too big - please reduce file size and try again.";
}
else {
$path = "$serverpath/" . $name;
foreach($allowedfiles as $allowedfile) {

if ($done <> "yes") {
if (file_exists($path)) {
echo "A file with this name already exists - please rename the file and reupload.";
exit;
}
}

if (substr($file, -3) == $allowedfile) {
move_uploaded_file($_FILES['file']['tmp_name'], "$path");
$done = "yes";
echo "<p>Your image has been successfully uploaded to our server and can be accessed using the URL provided below.</p>";
echo "<p><img src='$urltoimages/$name' border='0'>";
echo "<p>Direct Link: <input name='direct' type='text' size='75' value='$urltoimages/$name'></a></p>";

}

}

if ($done <> "yes") { print "<p><b>Error:</b> Your image as not been uploaded becuase it is not a recognised image file. Please try again.</p>"; }
}
}

?>

I made that, feel free to edit it

That's a pretty nice little script. Do you mind if I edit it to add some more advanced features?

letisix
11-03-2007, 08:31 PM
I made that, feel free to edit it - Lol

Jaymai
11-03-2007, 08:32 PM
London check pm's

Drompo
11-03-2007, 08:34 PM
Feel free to edit it.

Just posted a tutorial for this.

TFerg006
11-03-2007, 08:37 PM
Works 100&#37; :) I want to make one like Uploadz.co.uk lol ? :(

timROGERS
12-03-2007, 07:16 AM
Works 100% :) I want to make one like Uploadz.co.uk lol ? :(

You'll need lots of bandwidth (and quite a lot of space) then :P:

http://www.uploadz.co.uk/tim/336uploadzinfo.png

Want to hide these adverts? Register an account for free!