Hi every one ,
I want to upload a file and having problem in uploading file i used this

$dir = "sites/default/files/images";
$temp = "temp";

if ($file = file_save_upload('file_name', $validators, $temp)) {
if(file_move($file->filepath,$dir)) {
drupal_set_message('Saved');
}
}else{
drupal_set_message('error uploading');
}

but when i upload file on local pc it is working fine but when i upload this on server error uploading message comes there. I also set File system path: to as sites/default/files And Temporary directory: set Temp what will be this error please any one tell me

Thanks

Comments

Arul.Anadocs’s picture

Hi every one,

Same problem for me also ,please any one tell me

Thanks,
Arulkumar

computer_jin’s picture

have u solved this problem ..........?

--
Azhar uddin
Technical Lead
email : engr.azharuddin@gmail.com
skype : computer_jin

mdixoncm’s picture

It could be the permissions on the 2 directories (the files dir and the temp dir) - you need to make sure that the apache user (the user that apache is running as) has the ability to write to the files and the temp dir.

Mike,
Computerminds offer Drupal development, consulting and training

computer_jin’s picture

Yes, I have checked that its already have ability to write the files on these folder...???

--
Azhar uddin
Technical Lead
email : engr.azharuddin@gmail.com
skype : computer_jin

computer_jin’s picture

still i m facing problem to upload files on server but files are uploading on my local pc.and i have checked permissions of directory but can any one specify my what will be this problem and how can i solve this problem .................

Azhar
4 Ace Technologies(www.4acetech.com)
karachi,Pakistan

--
Azhar uddin
Technical Lead
email : engr.azharuddin@gmail.com
skype : computer_jin