Sven Mintel
Mitglied
Ich habe gesehen das der Wert in dem Input MAX_FILE_SIZE Feld in Byte angegeben ist..
Dieses Input hast du aber gut vor uns versteckt :suspekt:
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Ich habe gesehen das der Wert in dem Input MAX_FILE_SIZE Feld in Byte angegeben ist..
$albumRefreshID=$_GET['showAlbum'];
$userID=$_SESSION['s_id'];
$useralbum = $_SESSION['s_vname']."_".$_SESSION['s_nname']."_".$_SESSION['s_id'];
$PicUploadAlbumName=$_GET['Albumname'];
//picname umbenennen
if(!empty($_FILES['uploadPic'])){
$originalPicName=$_FILES['uploadPic']['name']; //originalnamen speichern.
//extension auslesen
$punkt = strrpos($originalPicName, '.');
$laenge= strlen($originalPicName);
$extension = substr($originalPicName, -($laenge - $punkt - 1));
require("connectdb.php");
$sql="Select pic_ID From Pics ORDER BY pic_ID DESC LIMIT 1";
$result=mysql_query($sql);
$newFileName = mysql_fetch_object($result);
$nameNumber= $newFileName->pic_ID;
$nameNumber++;
$newPicName=$userID."_".$nameNumber.".".$extension;
$path="./user/".$useralbum."/".$PicUploadAlbumName."/".$newPicName;
mysql_close($dbh);
$tmppath = "./user/tmp-pic/".$newPicName;
move_uploaded_file($_FILES['uploadPic']['tmp_name'],$tmppath);
$image=$tmppath; //image auf eine gewisse größe zuschneiden und in den user ordner verschieben ---->
$target = $path;
$max_width = "800";
$quality = "90";
if($extension == "jpg"){
$src_img = imagecreatefromjpeg($image);
}else if($extension == "jpeg"){
$src_img = imagecreatefromjpeg($image);
}else if($extension == "gif"){
$src_img = imagecreatefromgif($image);
}else if($extension == "png"){
$src_img = imagecreatefrompng($image);
}else if($extension == "JPG"){
$src_img = imagecreatefromjpeg($image);
}
$picsize= getimagesize($image);
$src_width = $picsize[0];
$src_height = $picsize[1];
if($src_width > $max_width){
$src_proz = ($max_width*100)/$src_width;
$src_proz = $src_proz/100;
$max_height = $src_height * $src_proz;
$newImg = imagecreatetruecolor($max_width, $max_height);
imagecopyresampled($newImg, $src_img, 0, 0, 0, 0, $max_width, $max_height, $src_width, $src_height);
imagejpeg($newImg, "$target", $quality); //<------
}else{
copy($tmppath, $path);
}
@unlink($tmppath);
require("connectdb.php");
// eintrag in die datenbank --->
$sqlinsert="INSERT INTO `Pics` (`originalPicName`, `picName`, `album_ID`, `user_ID`) VALUES ( '".$originalPicName."','".$newPicName."','".$albumRefreshID."','".$_SESSION['s_id']."')";
mysql_query($sqlinsert);
$sqlalbum="Select album_Pictures From Album Where album_ID='".$albumRefreshID."' AND '".$_SESSION['s_id']."'";
$resultalbum=mysql_query($sqlalbum);
$count = mysql_fetch_object($resultalbum);
$picsInAlbum=$count->album_Pictures;
$picsInAlbum++;
$datetime=date("Y-m-d H:i:s");
$sqlupdate="Update Album SET album_Pictures='".$picsInAlbum."' , album_refresh='".$datetime."' WHERE album_ID='".$albumRefreshID."' AND user_ID='".$_SESSION['s_id']."'";
mysql_query($sqlupdate);
//<-------
echo "<meta http-equiv='refresh' content='0.1 URL=?index=1&pics=edit&user=showAlbum&showAlbum=".$albumRefreshID."&Albumname=".$PicUploadAlbumName."'>";
}
?>
Warning: imagecreatefromjpeg(./user/tmp-pic/25_52.JPG) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/SS10_wet2/public_html/Gruppe_Krammer/uploadpic.php on line 50
Warning: getimagesize(./user/tmp-pic/25_52.JPG) [function.getimagesize]: failed to open stream: No such file or directory in /home/SS10_wet2/public_html/Gruppe_Krammer/uploadpic.php on line 54
Warning: copy(./user/tmp-pic/25_52.JPG) [function.copy]: failed to open stream: No such file or directory in /home/SS10_wet2/public_html/Gruppe_Krammer/uploadpic.php on line 70