create folder php 1

create folder php

// Create folder if not exist
		$folderName = 'images/gallery';
		$config['upload_path'] = $folderName;
		if(!is_dir($folderName))
		{
			mkdir($folderName, 0777);
		}

Here is what the above code is Doing:
1. We are creating a folder named images/gallery if it doesn’t exist.
2. We are setting the upload path to the folder we just created.
3. We are setting the allowed file types.
4. We are setting the maximum size of the file.
5. We are setting the maximum width of the image.
6. We are setting the maximum height of the image.
7. We are setting the file name of the image.

Similar Posts