![]() |
Simple Image Uploader
I still see an abundance of image uploaded sites popping up.. so I got bored, and had a domain lying around, so I built a very simple application that people can use if they'd like.
A live (permanent) demo of the script is located at Free Image Hosting! You can upload images there if you'd like, or you build your own, by using the source code shown below! PHP Code:
|
$_FILES['userfile']['type'] is sent by the user thats uploads the file. you should check the file type with getimagesize()
|
Just add any fixes you have :D Sort of like an Open Source project :P
|
You should also check the extention, because someone could upload a valid image with some random php code at the end and your script will save it as .php so it will run. Don't have the time to fix this now but maybe later...
|
Yeah, i'd like to see you guys add to the code rather than just giving recommendations.. I want to see how you all would do it yourselves, so I can get hints in my future programming.
|
Did anyone have the extention so you cant upload random php code ?
|
Use $filename = $_FILES['fieldname']['name']; to find the uploading file's name. Then just use
$filetype = explode('.', $filename); $filetype = end($filetype); to find the file exstention. Also, please don't bump old topics. |
@TerrorRonin.
I get the lazy vibe from this post. Why donīt you take the recommendations and change the code yourself? |
(Emphasis aded by Salathe)
Quote:
|
| All times are GMT. The time now is 02:59 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0