PDA

View Full Version : Image upload script?



Berch
04-07-2009, 08:51 PM
Well..

To cut a long story as short as possible. I have a server which isn't really doing much compared to what it could but it still gets paid for every month cause I need it for the odd task and so on.

Anyway. I was thinking about it and I decided to use it for a imagehost site cause the server is on a 1GB connection and 99% of the time it's not being used so thought it would be awesome to use for myself and anyone else who wishes to use it if I or they ever needed to upload some images for screenshots, pictures whatever I posted and wanted to link them on HxF or where ever would get nice fast loading times and uploads and so on.

Anyway. It's more or less setup accept. I don't have an image upload script I done some Google searching but couldn't find anything I liked.

Really. I just want a simple one which can upload, upload multiple files and resize if the user wishes any possibly any other features you think would be useful.

If you know of anything. Let us know here or any ideas for the site that you would like to see on it. Also let me know either here or VIA a PM.

If you could make a nice script for yourself for a good and nice looking image upload script let us know but I wont go into detail cause that would belong in 'Paid Requests' section but if you think you could make one and a good one at that. Let us know VIA PM and we can discuss price and everything else.

But I will end that here before it does get to long.

Thanks in advance to everyone for suggestions and everything else.

Moved by N!ck (Forum Moderator) from "Technology Discussion".

jackass
04-07-2009, 09:27 PM
Here's a basic one, simple but effective. Fiddle around with it if you want to make some changes!


<?php
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;

if ($uploaded_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}

if ($uploaded_type =="text/php")
{
echo "No PHP files<br>";
$ok=0;
}

if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}

else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?>

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