All Products 
Username / Customer#
Password
Log In
 Hi,  |  Log Out
  • Site Search
  • Domain Search
  • WHOIS Domain Check
24/7 Support: (480) 505-8877
Hablamos Español
9 AM to 9 PM IST
7 days a week
Go Daddy Support

Search help articles, forums, and discussion groups

PHP FTP image upload

Viewing post 1 to 7 (7 total posts)
Profile picture of AntonySmith

antonysmith said 1 year, 1 month ago:

I’m having an issue with my script uploading to GoDaddy. It works perfectly fine on my dev machine.

Could you take a look:
<?php

$path = “uploads/”;

$valid_formats = array(“jpg”, “png”, “gif”, “bmp”);
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == “POST”) {
$name = $_FILES['photoimg']['name'];
$size = $_FILES['photoimg']['size'];

if(strlen($name)) {
list($txt, $ext) = explode(“.”, $name);
if(in_array($ext,$valid_formats)) {
if($size<(1024*1024)) {
$actual_image_name = time().substr(str_replace(” “, “_”, $txt), 5).”.”.$ext;
$tmp = $_FILES['photoimg']['tmp_name'];
if(move_uploaded_file($tmp, $path.$actual_image_name)) {
echo “<img src=’uploads/”.$actual_image_name.”‘ class=’preview’><p>”.$actual_image_name.”</p>”;
} else
echo “failed”;
} else
echo “Image file size max 1 MB”;
} else
echo “Invalid file format..”;
} else
echo “Please select image..!”;

exit;
}
?>

Profile picture of Sherrod

GoDaddy Expert sherrod said 1 year, 1 month ago:

@antonysmith,

Is there an actual error that is being listed when utilizing this? If so please reply back with the URL so we can review this further.

It may also be related to the Upload limit within the initialization file. The following may help:

What is the PHP upload limit on Linux Shared Hosting accounts?

Sherrod

Profile picture of AntonySmith

antonysmith said 1 year, 1 month ago:

Update: I just looked at the FTP File Manager and added Web User Permissions ‘Write’ but its still not working. I guess its not a server side issue.

Profile picture of AntonySmith

antonysmith said 1 year, 1 month ago:

I’m using an Ajax script I found on the internet http://www.9lessons.info/2011/08/ajax-image-upload-without-refreshing.html (Without the mysql database stuff) so its not returning an error.

I’m attempting to upload an image that’s 1.70 KB .png with dimensions of 32 x 32 px. It cant be the file size.

The url for the user interface is http://thedarkestday-themovie.com/ADMIN/update_news.php which is currently password protected.

Profile picture of AntonySmith

antonysmith said 1 year, 1 month ago:

Why do my reply’s never appear immediately?

Profile picture of AntonySmith

antonysmith said 1 year, 1 month ago:

Any update on this issue? Is GoDaddy looking into my issue?
Cheers

Profile picture of JasonP

GoDaddy Expert JasonP said 1 year ago:

@antonysmith

I apologize for the delay in getting a response to you. Quick answer for the delay in your posts being seen: All posts are held for moderation.

Have you been able to resolve the issue?

Jason

Add a reply:

You will auto join this group when you reply to this topic.

When posting about a technical issue, please be sure to include as many details as possible, such as your domain name, related URLs and other pertinent information. This consideration will allow us to better understand the situation and quickly assist you.