kunal@localhost$

foss.in/2008 announced

Posted in FOSS, Linux, foss.in by kunalbharati on August 29th, 2008

Dates are out for foss.in/2008. And this is fourth consecutive year I wont be able to go because of exams :(

I had been there two times and every year I wait for the event to be announced. I have to say its a great event to be a part of.
This is the last year of my MCA course and I hope I will be a part of foss.in/2009

Tagged with: , ,

falling in love

Posted in Personal, Quotes by kunalbharati on August 7th, 2008

Falling in love is not at all the most stupid thing that people do — but gravitation cannot be held responsible for it : Albert Einstein

Tagged with: ,

Kartik is DD :)

Posted in Debian, Linux by kunalbharati on August 5th, 2008

Kartik @ Debian

Kartik gave me good news today.
Kartik is officially a Debian Developer now.

Congratulations Kartik..

Tagged with: ,

Uploading files with PHP

Posted in PHP by kunalbharati on July 15th, 2008

During my recent project I learned about uploading files using. For uploading files with PHP first step is to create a HTML form:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
   <BODY>
      <FORM METHOD='POST' ACTION='upload.php' ENCTYPE='multipart/form-data'>
         <INPUT NAME="image" TYPE="file" />
         <INPUT TYPE='Submit' VALUE='Upload' />
      </FORM>
   </BODY>
</HTML>

For form the attribute ENCTYPE='multipart/form-data' is very important.

Next step is to create a PHP script upload.php which will upload the file:


<?php
// Path where the file will be uploaded
$target_path = "/var/www/";

$file  = $_FILES['image'];
$temp = $file['tmp_name'];
if(is_uploaded_file($temp))
{
   if(move_uploaded_file($temp, $target_path.$file['name']))
   {
      echo "Upload successfull.";
      echo "File type is: ".$file['type'];
      echo "File size is: ".$file['size']/1024. " kb";
   }
   else
   {
      echo "File cannot be moved to $target_path";
   }
}
else
{
   echo "Unable to upload!";
}

?>

The target path given is an absolute path. I tried to give relative path but it didnt work. If you are using windows you can give path like “c:\\some_directory\\”.

Tagged with:

Why Debian?

Posted in Debian, Linux by kunalbharati on July 12th, 2008

I have been using Linux since 2001. And amongst all the Linux distributions and other Operating Systems used Debian is my favorite.

Debian

I love debian because of the bunch of reasons:

  • Its free.
  • It is the best development environment.
  • It is not bloatware like other distributions. It works on my old system too.
  • The /usr/share/doc directory is great.
  • People think debian is “only for geeks” distro. No its not. It includes all the applications that can be used on daily basis like Office suites (Openoffice, KOffice), Audio/Video players (Vlc, Kaffiene etc), Browsers (Firefox is known as Iceweasel in debian), Messengers (Pidgin, Kopete) and many many more. My sister is not a programmer but she uses debian too.

Here is an interesting link: Why Debian?

Tagged with: ,