php image upload problem at godaddy

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
raiden555
Forum Newbie
Posts: 5
Joined: Thu Apr 09, 2009 8:58 am

php image upload problem at godaddy

Post by raiden555 »

recently ...i tried image upload php script ...it woks well at my local server...but when i tried same php script in my php host account at godaddy.....i couldnt upload images in the folder i specified...can some one please HELP me to resolve this issue....its urgent!!!!!!!!!!!!!!!

thanks in advance
samvel
raiden555
Forum Newbie
Posts: 5
Joined: Thu Apr 09, 2009 8:58 am

Re: php image upload problem at godaddy

Post by raiden555 »

SOME ONE PLEASE HELP ME ...ITS REALLU URGENT....

THANKS IN ADVANCE
SAMVEL
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: php image upload problem at godaddy

Post by Benjamin »

Don't bump again :evil:
Forum Rules 1 1.1 4 wrote: 4. All users of any level are restricted from bumping (as defined here) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not receive a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: php image upload problem at godaddy

Post by Apollo »

Is the folder writable? (did you chmod it?)

Otherwise, post your code here.
raiden555
Forum Newbie
Posts: 5
Joined: Thu Apr 09, 2009 8:58 am

Re: php image upload problem at godaddy

Post by raiden555 »

yup i changed the access permissions of the folder to which i gonna write to...

the folder to which i gonna write is gallery_images

i tried even ftp image upload...but i got failure message

Code: Select all

 
$title=addslashes($_POST['title']);
 
$ftp_server = "ftp.anysite.com";
$ftp_user = "******";
$ftp_pass = "******";
 
// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
 
// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
  echo "Connected as $ftp_user@$ftp_server\n";
} else {
  echo "Couldn't connect as $ftp_user\n";
}
 
// close the connection
ftp_close($conn_id);  
 
 
 
$path = 'ftp.anysite.com/gallery_images/';
 
 
if(isset($_FILES['file']) && is_uploaded_file($_FILES['file']['tmp_name']))
{
$filename = $_FILES['file']['tmp_name'];
$destination = $path . $_FILES['file']['name'];
if (file_exists($destination))
{ echo 'File already exists!<br />'; }
else
if(move_uploaded_file($filename,$destination))
{ echo 'File uploaded!<br />'; 
$temp5="gallery_images/". $_FILES['file']['name'];
}
else
{ echo ' ** Failure! ** <br />'; }
}
 
Last edited by Benjamin on Thu May 07, 2009 9:17 pm, edited 1 time in total.
Reason: Added [code=php] tags.
ldougherty
Forum Contributor
Posts: 103
Joined: Sun May 03, 2009 11:39 am

Re: php image upload problem at godaddy

Post by ldougherty »

What exactly happens when you try and upload the file? Are you getting a PHP error or nothing at all? Do you have access to the raw logs to see what the actual PHP error is?

Check the value of upload_tmp_dir in your php.ini to make sure that the path exists and is writeable otherwise you won't be able to upload via PHP.
Post Reply