<?php
if(isset($_POST[‘submit’]))
{
if(count($_FILES[‘upload’][‘name’]) > 0){
//Loop through each file
for($i=0; $i<count($_FILES[‘upload’][‘name’]); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES[‘upload’][‘tmp_name’][$i];
//Make sure we have a filepath
if($tmpFilePath != “”){
//save the filename
$shortname = $_FILES[‘upload’][‘name’][$i];
//save the url and the file
// chmod(“http://107.170.36.57/wp-content/uploads/product/”,0755);
$newfile = “http://107.170.36.57/wp-content/uploads/product/”;
if($newfile==true )
{
$filePath = “http://107.170.36.57/wp-content/uploads/product/” .$_FILES[‘upload’][‘name’][$i];
echo $filePath.”
“;
}
else
{
echo “upload not possible”;
}
//Upload the file into the temp dir
chmod(“http://107.170.36.57/wp-content/uploads/product/”,0755);
if( move_uploaded_file($tmpFilePath, $filePath)== true)
{
echo “true there”;
$files[] = $shortname;
}
else
{
echo “not possible”;
}
}
}
/* foreach($file1 as $f)
{ echo $f.”
“; }
array_push($attachments,$f);
*/
}
$var = count($files);
for($i = 0;$i < $var; $i++)
{
$val = “http://107.170.36.57/wp-content/uploads/product/”.$files[$i];
//echo $val.”
“;
$attachments[] = $val;
}
}
foreach($attachments as $a)
{
$a.”
“;
}
}
this is code
Hello harshap,
Have you changed the /uploads folder permissions recursively ?If not please try changing the permission recursively to all folder inside the uploads folder.
Thanks
Hello Clarion Technologies thanks for reply
I changed the permission to 0755 and even to 0777 but its still not working…
Thanks
Prakash