I have been tried many times to move the uploaded image or file in a location and also store the name in database.
All the functions work perfectly in LocalHost, but not on Server. Neither I can see any thing in the directory of a server not any info of the uploaded file in a database.
I have googled and tried almost every trick to solve the issue. Common solution is to edit the permission of a folder. I did it too but all in vain.
What can be the solution ? What am I doing wrong ? The following code works perfectly if using Local host .
$destination_path ="uploads/";
$target = $destination_path.basename( $_FILES["Upload"]["name"]);
$filename=$_FILES['Upload']['name'];
$filetype=$_FILES['Upload']['type'];
$filetmp=$_FILES['Upload']['tmp_name'];
$images=move_uploaded_file($filetmp, $target);
$attachment = file_get_contents($_FILES["Upload"]["tmp_name"]);
$ins_sql="INSERT INTO wp_reklamation(Vorname,Nachname,Auftragsnummer,name,Upload,Grund,Wunsch,Telefonnummer,Email) VALUES('$vorname','$nachname','$auftrag','$filename','$images','$grund','$wunsch','$telefon','$email')";
Moreover, to send the attachment is also an issue. But I believe if this problem first can get resolved, I can solve that mail problem by using the above parameters . But Ofcourse nothing is selected nor moved in the location and database, then how can mail send the item name or anything else related to it .
Thanks