What extension does xampp accepts for images. jpeg or png or anything else ?
XAMPP accepts any files. It is up to you as the programmer to validate and verify that the user is indeed uploading only images. There are a number of ways to do this. For example something done in this question.
How can we implement this task ? i need a little start cuz i don't know where to start.
This is a very broad question. How you want to do this depends on your needs and how the rest of the application is structured. Just the bare bone uploading functionality is actually very, very simple. Just Google "php file upload example" should give you many examples. For example something like this.
Are the BLOB and file-system different things?
A file system is just like the files on you machine. A web server (and XAMPP) is just a computer running some software to answer your requests. When you upload a file to this server, it is basically the same thing as downloading a file from the Internet on your machine. The files on your machine under My Documents is basically the same as files uploaded via a web form. BLOB is a collection of binary data stored in a database. This format is useful for storing huge values. It is not relevant for you.
Should we create a table for images of a folder?
That is really up to how you want to do it. You could place all the images in a single directory. However, if there are going to be a lot of images in this directory, it may become slow. What is a common pattern is to use the first letter of the file name and create a directory for that. For example, something like this:
// Upload file target
$uploadDirectory = '/path/to/directory/';
// Create a "random" hash
$randomHash = md5(rand() . '---' . time());
// Name the file randomhash.fileending
$fileName = $ranomHash . '.' . $fileEnding;
// Find the first letter of the filename
$firstLetter = substr($fileName, 0, 1);
if (!file_exists($uploadDirectory . $firstLetter)) {
// Directory does not exists, create it
makedir($uploadDirectory . $firstLetter);
}
// Final path is now constructed
$finalPath = $uploadDirectory . $firstLetter . '/' . $fileName;
// For example, if your file is named aabbcc.png, then the $finalPath is:
// /path/to/directory/a/aabbcc.png
// When you have moved the file to this directory, you can store this string in the database