Hi guys,
I am having some problems with a script we use in our webshop. The error is only periodic and seems to show up without any changes made by us or our host.
I've had the host reinstall PHP and FTP as well as reset the firewall and httpd.conf files but without any luck.
The error I get is when I try to upload a product picture through our admin page:
Warning: ftp_put(): Accepted data connection in /xxx/xxx/public_html/include/functions.php on line 132
It seems to be when trying to upload images larger than 10kb as it works with very small files.
The functions we use to upload is:
function upload_file($source_file, $destination_file) {
if ($conn_id = ftplogin()) {
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
if (!$upload) {
return "Det lykkedes ikke at uploade $source_file til $destination_file";
}
ftp_close($conn_id);
} else {
return "Det var ikke muligt at forbinde vha. FTP";
}
return false;
}
function ftplogin() {
$conn_id = ftp_connect(FTP_SERVER,21);
$login_result = ftp_login($conn_id, FTP_USER, FTP_PASS);
if (!$conn_id || !$login_result) {
return false;
}
ftp_pasv($conn_id, true);
return $conn_id;
}
Any help is greatly appreciated!
Thank you,
Jesper