Latest Entries »

Dear All,
After seeing so many questions on how we can do secure uploading of images on the server, i am gonna post a theory of how to do this effectively.
Very first method which is basic uploading:
We just browse an image from our local machine and upload them as following. This method is called a naive method.

<code><?php

if (!empty($_FILES['yourFileName']['name']))
{
// To upload the Image.
$name = $_FILES['yourFileName']['name'];
$type = $_FILES['yourFileName']['type'];
$size = $_FILES['yourFileName']['size'];
$source = $_FILES['yourFileName']['tmp_name'];
$destination = “images/”.$name;
move_uploaded_file($source, $destination);
}

?>

</code>

This uploading is done through a normal html form tag

<code>

<form action=”" method=”post” enctype=”multipart/form-data”>

<input type=’file’ name=’yourFileName’ />

<input type=’submit’ value=’Upload’ />

</form>

</code>

Unfortunately this has several flaws-
1 – It can easily be guessed that where are to putting your files and so anybody can upload any PHP script or any executable file and get your server down.
2 – For an example somebody can upload a file which enables shell commands on your machine as following

and can do anything with your server.
So this way is never suggested.
A simple solution at the first site seems to check for the file type being uploaded. so putting a simple script
if($_FILES['yourFileName']['type'] != ‘image/jpg’)
{
//Error
}
Can make your script secure a bit but unfortunately it also has some flaws. I will explain that in my next blog.

Dear All,
We, after putting a huge effort finally launched our brand new website http://www.gadb.in. This website is based on the idea to make people aware of everything happening around them. Currently we are focusing to publish general information such as about world, Indian history, general mathematics etc. In future we are looking to post new and most relevant things for the people.
This is a unique website of it’s type. Look and feel is very good and so many things are coming up… Hope you will enjoy it…

My first blog

Hello everyone,

It’s been a long long time since i created this blog for me and today i just thought to start blogging. This is for the first time that i am posting anything here as i have been quire busy with my other works. After a huge effort i finally have become successful to open my own company and with this now i can say that i am an entrepreneur.

I have opened my organization named Eudoxia Technologies and just launched our first product http://www.gadb.in. Thanks to my friend and co-founder of Eudoxia Technologies, Pranav who has always been motivating me to do this and for writing thousand of lines of code for our first website.

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Follow

Get every new post delivered to your Inbox.

Join 172 other followers