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
php image upload problem at godaddy
Moderator: General Moderators
Re: php image upload problem at godaddy
SOME ONE PLEASE HELP ME ...ITS REALLU URGENT....
THANKS IN ADVANCE
SAMVEL
THANKS IN ADVANCE
SAMVEL
Re: php image upload problem at godaddy
Don't bump again
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.
Re: php image upload problem at godaddy
Is the folder writable? (did you chmod it?)
Otherwise, post your code here.
Otherwise, post your code here.
Re: php image upload problem at godaddy
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
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.
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
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.
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.