File uploading is not working

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
asmitacp
Forum Newbie
Posts: 16
Joined: Wed Mar 26, 2008 7:36 am

File uploading is not working

Post by asmitacp »

Hiiii,
I am using file uploading in my program but it is not working...
Following is the code..............

<?php

$tmp_name = $_FILES["text_file"]["tmp_name"];
$name = $_FILES["text_file"]["name"];
if(move_uploaded_file($tmp_name, "$uploads_dir/$name"))
echo"file moved proerly!!!";
else
echo"error in file uploading!!!!!!";


?>



Can anybody help me ?????
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: File uploading is not working

Post by susrisha »

Code: Select all

 
$tmp_name = $_FILES["text_file"]["tmp_name"];
$name = basename($_FILES["text_file"]["name"]);
$upload_path = $uploads_dir.'/'.$name;
if(move_uploaded_file($tmp_name, $upload_path))
echo"file moved proerly!!!";
else
echo"error in file uploading!!!!!!";    
 
Try to replace the code with this..
asmitacp
Forum Newbie
Posts: 16
Joined: Wed Mar 26, 2008 7:36 am

Re: File uploading is not working

Post by asmitacp »

It shows error message

error in file uploading!!!!!!
asmitacp
Forum Newbie
Posts: 16
Joined: Wed Mar 26, 2008 7:36 am

Re: File uploading is not working

Post by asmitacp »

Its working ...
problem was in folder permission.......
Post Reply