<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px" 
id=MailContainerBody leftMargin=0 topMargin=0 bgColor=#ffffff 
CanvasTabStop="true" name="Compose message area">
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A 
title="mailto:polettix@gmail.com&#10;Ctrl + clic per seguire il collegamento" 
href="mailto:polettix@gmail.com">Flavio Poletti</A> </DIV>
<DIV><B>Sent:</B> Sunday, September 13, 2009 12:21 PM</DIV>
<DIV><B>To:</B> <A 
title="mailto:roma@pm.org&#10;Ctrl + clic per seguire il collegamento" 
href="mailto:roma@pm.org">roma@pm.org</A> </DIV>
<DIV><B>Subject:</B> Re: [Roma.pm] domanda</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT size=2 face=Arial>#!/usr/bin/perl -w<BR>use warnings;<BR>use CGI qw( 
:standard );<BR>use DBI;<BR>use CGI;<BR>my $myfile = "000036.png";<BR>#my 
$myfile = "picture.png";<BR>#my $dbname = "MyDatabase";<BR>my $dbname = 
"vestiario";<BR>print header,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
start_html(-title =&gt; "vesto");<BR>my $dbh = 
DBI-&gt;connect("dbi:mysql:database=$dbname") || die "Cannot open db";<BR>open 
MYFILE, $myfile&nbsp; or die "Cannot open file";<BR>my $data;<BR>while 
(&lt;MYFILE&gt;) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $data .= 
$_;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>close MYFILE;<BR>my $sql 
= "INSERT INTO Immagine (Image) VALUES (?)";<BR>my $sth = 
$dbh-&gt;prepare($sql);<BR>my $numrows = 
$sth-&gt;execute($data);<BR>$sth-&gt;finish;<BR>$dbh-&gt;disconnect;<BR>print 
br;<BR>print "OK 
load",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
end_html;</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Ho usato nel MySQL&nbsp;<FONT size=3 
face="Times New Roman"> la tabella con tipo 'longblob' . Ho fatto diversi 
tentativi: </FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">scopo 
</FONT></FONT>carico $myfile nella tabella con tipo blob. </DIV>
<DIV>DBI funziona, con Mysql funziona, solo con il tipo blob ho delle 
difficoltà.</DIV>
<DIV>**********************************************************************</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV>Cosa hai provato fino ad ora? Suggerirei di partire da quel che hai fatto 
per capire quali siano state le difficoltà.</DIV>
<DIV><BR></DIV>
<DIV>Aspettiamo.</DIV>
<DIV><BR>
<DIV class=gmail_quote>2009/9/13 <SPAN dir=ltr>&lt;<A 
title="mailto:umbertobernardelli@live.it&#10;Ctrl + clic per seguire il collegamento" 
href="mailto:umbertobernardelli@live.it">umbertobernardelli@live.it</A>&gt;</SPAN><BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
class=gmail_quote>cerco un aiuto<BR>ho alcune difficoltà a caricare immagini 
  su MySQL con il perl licenza free.<BR>Qualcuno potrebbe inviarmi un esempio 
  completo?<BR>aspetto 
  <DIV>
  <DIV></DIV>
  <DIV 
  class=h5><BR><BR><BR>_______________________________________________<BR>Roma 
  mailing list<BR><A href="mailto:Roma@pm.org" 
  target=_blank>Roma@pm.org</A><BR><A 
  href="http://mail.pm.org/mailman/listinfo/roma" 
  target=_blank>http://mail.pm.org/mailman/listinfo/roma</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV>
<P>
<HR>

<P></P>_______________________________________________<BR>Roma mailing 
list<BR>Roma@pm.org<BR>http://mail.pm.org/mailman/listinfo/roma</BODY></HTML>