image resize

From: Alberto Bonvicin (alberto_at_leveldesign.it)
Date: 09/24/04


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



Relevant Pages

  • Re: poor performance on first query
    ... > LIKE keyword OR memofield LIKE keyword ORDER BY field3 DESC ... Are the thumbnails embedded in the database or does the database simple have ... a path reference to the thumbnail file? ...
    (microsoft.public.inetserver.asp.db)
  • Re: ACDSee or Bridge
    ... "Live" apps like IrfanView have to make the thumbnails every time you ... "Database" viewers like ThumbsPlus store the thumbnails once made so ... quick viewing access but takes some disk space to store the thumbs. ... Put 10k images in a folder and the database method is quicker by ...
    (alt.graphics.photoshop)
  • Re: unlinking linked image files.
    ... Currently all my digital assets (scanned drawings, digital artwork, photos, ... database thumbnails are on the same computer as the database which is also ... If not is there an easy way to tell access that the thumbnail folders have ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Strategy for scanning complete 35mm negative collection
    ... >>thinking of using the scanner as a catalogue device and just save a ... >>Then I can go through the thumbnails and select the pictures I want to ... Can I save just the thumbnails on the Nikon? ... A good Cataloging/Thumbnailing Database is ThumbsPlus. ...
    (comp.periphs.scanners)
  • Re: What is it
    ... It's a Windows system file. ... if you open a folder in Windows ... Explorer that is set to view thumbnails this file ... Essentially it is a system database of the thumbnails of all ...
    (microsoft.public.frontpage.client)