image resize
From: Alberto Bonvicin (alberto_at_leveldesign.it)
Date: 09/24/04
- Next message: Craig Keightley: "Number question"
- Previous message: cool: "Re: Split string"
- Next in thread: Ehtor: "Re: image resize"
- Reply: Ehtor: "Re: image resize"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Sep 2004 15:38:03 +0200
I've this script for upload images in MySql Db, now i want to put in
Database the thumbnails
CODE:
$dbcnx = mysql_connect('localhost','user','pass');
mysql_select_db('leveldes_level');
//Recupero il percorso temporaneo del file
$gal = $_POST['galleria'];
$path = $_FILES['userfile']['tmp_name'];
$file = $_FILES['userfile']['name'];
$filetyp = substr($file, -3);
if ($filetyp == 'gif' OR $filetyp == 'jpg') {
$handle = fopen($path,'r');
$file_content = fread($handle,filesize($path));
$encoded = chunk_split(base64_encode($file_content));
$sql = "INSERT INTO images2 SET sixfourdata='$encoded', galleria='$gal'";
mysql_query($sql);
fclose($handle);
echo("File caricato<br>");
echo("<a href=\"view.php?gal=$gal\">Visualizza nella galleria $gal</a>");
}else{
echo("tipo di file errato");
}
mysql_close($dbcnx);
Help
alberto@leveldesign.it www.leveldesign.it
- Next message: Craig Keightley: "Number question"
- Previous message: cool: "Re: Split string"
- Next in thread: Ehtor: "Re: image resize"
- Reply: Ehtor: "Re: image resize"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|