Image Upload Script

Soldato
Joined
4 Jul 2004
Posts
2,647
Location
aberdeen
Hello
I want to make a site similar to imageshack.us, no sign up, just a browse input box, and submit, you click submit and you get the code. However I want to write it myself, any good tutorials about this?

I've found some, but none deal with making sure it is under xMB, or is a gif/png/jpg etc

Thanks
 
Soldato
Joined
12 Jun 2005
Posts
5,361
I have created one, from a load of tutorials, cannot remember them all.

I am also very new to php and am very poor with markup efficiency, so there may be a better was of doing it.

That in mind, you are welcome to have a look at it, and includes the things to make sure it's under a certain size and makes it so you can only upload images.

Here is what I used to correct certain security flaws in the PHP: Roblog Secuirty Guide

Click Here for script - uploaded using Beansprouts Uploader

Hope this helps!







EDIT:

Link to php script updated
 
Last edited:
Man of Honour
Joined
31 Jan 2004
Posts
16,335
Location
Plymouth
I looked at the first 3 lines of that script and I'd change the config varialbes to constants:

Code:
 $config['script']['localpath'] = "/local/path/to/uploads/";
    $config['script']['webpath'] = "http://www.yourdomain.com/uploads/";
To:
Code:
define('LOCAL_PATH', '/local/path/to/uploads/');
define('WEB_PATH', 'http://www.yourdomain.com/uploads/');

<<< This is what I do when I'm bored. Point out handy little PHP features which don't really have any useful impact to the user :)
 
Back
Top Bottom