index.html
<html>
<head>
<title>Excel Upload</title>
</head>
< body >
<center><h2>Excel Upload</h2></center>
<form action = "upload.php" method = "POST" enctype = "multipart/form-data" >
<input type="file" name="file"/> < input type = "submit" value = "Upload" >
< /form>
</body >
< /html>
upload.php
<?php
$name = $_FILES['file']['name'];
$file = $_FILES['file']['tmp_name'];
$handle = fopen($file, "r");
$c = 0;
$location ="images"
while(($filesop = fgetcsv($handle, 1000, ",")) !== false)
{
$file = $filesop[0];
$file_name = $file[0]['name'];
$file_tmp_name = $file[0]['tmp_name'];
move_uploaded_file($file_tmp_name,"$location/$file_name");
$c++;
}
?>
- When User Upload the .csv file read the file path move the image to particular Directory