Ny server, nu bliver billeder ikke uploadet
Hej,Sitet her har fået ny server og siden har den ikke uploadet billeder til news modulet. Random navn på billeder bliver genereret og al tekst bliver uploadet men selve filerne bliver ikke uploadet.
1. triplan_news/pictures
2. triplan_news/pictures/full
3. triplan_news/pictures/preview
Har alle 777 i tilladelser, ikke at jeg tror 1. er nødvendig, det er vel kun selve mappen billederne skal i der skal kunne skrives til?
Jeg tænker der er et problem med path til billederne...
Følgende fik jeg at vide af dem der har serveren:
"Når du logger på FTP hedder webdir folderen httpdocs/triplan.net/"
Når jeg logger på med ftp client ser stien således ud:
/webspace/httpdocs/tools/triplan_news/pictures/full
Jeg har prøvet mange kombinationer, men ved ikke hvad den rigtige er :(
:: Kode ::
config_triplan.php:
<?php
# online
define ("DB_HOST","XXXX");
define ("DB_NAME","XXXX");
define ("DB_USER","XXXX");
define ("DB_PASSWORD","XXXX");
$path_picture_full = "/httpdocs/triplan.net/webspace/httpdocs/tools/triplan_news/pictures/full/";
$path_picture_prev = "/var/www/triplan/triplan.net/www/tools/triplan_news/pictures/preview/";
$path_pdf = "/var/www/triplan/triplan.net/www/tools/triplan_news/pictures/pdf/";
$http_path_picture_full = "/tools/triplan_news/pictures/full/";
$http_path_picture_prev = "/tools/triplan_news/pictures/preview/";
$http_path_pdf = "/tools/triplan_news/pictures/pdf/";
$http_path = "http://www.triplan.net/tools/triplan_news/";
// debug
#$br = "<br>";
$br = "\n";
?>
add_data.php:
<?php
# #######################################
# triplan_admintool add data V 1.0
# initial 30.03.2004 koehler@georgi-group.com
#
# writes new newses into the db
# #######################################
include_once('../../lib/config_triplan.php');
include_once('../../lib/adodb421/adodb.inc.php');
#if($_SERVER['SERVER_NAME'] == "larsomat")
#{
$headline = $_POST["headline"];
$teaser = $_POST["teaser"];
$content = $_POST["content"];
$link = $_POST["link"];
$MAX_FILE_SIZE_USERPDF = $_POST["MAX_FILE_SIZE_USERPDF"];
$userpdf = $_POST["userpdf"];
$MAX_FILE_SIZE_USERGFXSMALL = $_POST["MAX_FILE_SIZE_USERSMALL"];
$usergfxsmall = $_POST["usergfxsmall"];
$MAX_FILE_SIZE_USERGFXBIG = $_POST["MAX_FILE_SIZE_USERGFXBIG"];
$usergfxbig = $_POST["usergfxbig"];
#}
###################################################
# handle file gfxsmall
###################################################
$usergfxsmall_name = $HTTP_POST_FILES['usergfxsmall']['name'];
#print $usergfx_name."<br>";
$usergfxsmall_tmp_name = $HTTP_POST_FILES['usergfxsmall']['tmp_name'];
#print $usergfx_tmp_name."<br>";
$new_gfxname = "";
$gfxsmallendung = strtolower(substr($usergfxsmall_name,-3));
if(($gfxsmallendung == "gif") || ($gfxsmallendung == "jpg") || ($gfxsmallendung == "jpeg") || ($gfxsmallendung == "jpe") AND ($usergfxsmall_name != ""))
{
/*$sizesmall = "";
$sizesmall = getimagesize ($usergfxsmall_tmp_name);
if($size[3] != "width=\"100\" height=\"75\"")
{
header("Location: add.php?msg=Imagesize+is+not+100+x+75");
exit;
}*/
$random = rand(1000,9999);
$zeit = time();
$new_gfxsmallname = $random."_".$zeit.".".$gfxsmallendung;
#print "<br>".$path_picture.$new_gfxname;
#print "das copi wird demnaechst ausgefuehrt!";
#print "<br>".$path_picture.$new_gfxname;
@copy ($usergfxsmall_tmp_name, $path_picture_prev.$new_gfxsmallname);
#$new_gfxname = $http_path_picture.$new_gfxname;
#print "<br>".$new_gfxname;
}
###################################################
# handle file gfxbig
###################################################
$usergfxbig_name = $HTTP_POST_FILES['usergfxbig']['name'];
#print $usergfx_name."<br>";
$usergfxbig_tmp_name = $HTTP_POST_FILES['usergfxbig']['tmp_name'];
#print $usergfx_tmp_name."<br>";
$new_gfxname = "";
$gfxbigendung = strtolower(substr($usergfxbig_name,-3));
if(($gfxbigendung == "gif") || ($gfxbigendung == "jpg") || ($gfxbigendung == "jpeg") || ($gfxbigendung == "jpe") AND ($usergfxbig_name != ""))
{
/*$sizebig = "";
$sizebig = getimagesize ($usergfxbig_tmp_name);
if($size[3] != "width=\"100\" height=\"75\"")
{
header("Location: add.php?msg=Imagesize+is+not+100+x+75");
exit;
}*/
$random = rand(1000,9999);
$zeit = time();
$new_gfxbigname = $random."_".$zeit.".".$gfxbigendung;
#print "<br>".$path_picture.$new_gfxname;
#print "das copi wird demnaechst ausgefuehrt!";
#print "<br>".$path_picture.$new_gfxname;
@copy ($usergfxbig_tmp_name, $path_picture_full.$new_gfxbigname);
#$new_gfxname = $http_path_picture.$new_gfxname;
#print "<br>".$new_gfxname;
}
###################################################
# handle file pdf
###################################################
$userpdf_name = $HTTP_POST_FILES['userpdf']['name'];
#print $userpdf_name."<br>";
$userpdf_tmp_name = $HTTP_POST_FILES['userpdf']['tmp_name'];
#print $userpdf_tmp_name."<br>";
$new_pdfname = "";
$pdfendung = strtolower(substr($userpdf_name,-3));
if(($pdfendung == "pdf") AND ($userpdf_name != ""))
{
$random = rand(1000,9999);
$zeit = time();
$new_pdfname = $random."_".$zeit.".".$pdfendung;
#print "<br>".$path_pdf.$new_pdfname;
#print "das copi wird demnaechst ausgefuehrt!";
#print "<br>".$path_pdf.$new_pdfname;
@copy ($userpdf_tmp_name, $path_pdf.$new_pdfname);
#print "copy ($userpdf_tmp_name, $path_pdf.$new_gfxname)";
#$new_pdfname = $http_path_pdf.$new_pdfname;
#print "<br>".$new_pdfname;
}
###################################################
# write data into db
###################################################
$conn = &ADONewConnection('mysql');
$conn->PConnect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$sql = "INSERT INTO triplan_news (id, timestamp, headline, teaser, content, picture_prev, picture_full, pdf, link, online_status) ";
$sql.= "VALUES ('', ";
$sql.= time().", ";
$sql.= "'".addslashes(substr($headline, 0, 50))."', ";
$sql.= "'".addslashes(substr($teaser, 0, 10000))."', ";
$sql.= "'".addslashes(substr($content, 0, 10000))."', ";
$sql.= "'".$new_gfxsmallname."', ";
$sql.= "'".$new_gfxbigname."', ";
$sql.= "'".$new_pdfname."', ";
$sql.= "'".$link."', ";
$sql.= "'1')";
#print $sql;
if($conn->Execute($sql) == false)
{
//print 'error inserting: '. $conn->ErrorMsg() .'<BR>';
print $err[db2];
exit;
}
header("Location: index.php");
exit;
?>