I have an entity mapped as:
/**
* @Entity @Table(name="Upload")
**/class Upload{/** @Id @Column(type="integer") @GeneratedValue **/protected
$id;
/** @Column(type="string") **/protected $nome;
/** @Column(type="blob") **/protected $arquivo;
When I use this (WORKS)
$query = "INSERT INTO Upload1 (name, size, type, content ) "."VALUES
('$fileName', '$fileSize', '$fileType', '$content')";
mysql_query($query)
When I use this doctrine way (NOT WORKING)
$upload = new Upload();
$upload-> setContent($content);
$upload-> setName($fileName);
$upload-> setSize($fileSize);
$upload-> setType($fileType);
$entityManager->persist($upload);
$entityManager->flush();
My html file:
<form method="post" enctype="multipart/form-data"><table width="350" border="0"
cellpadding="1" cellspacing="1" class="box"><tr> <td width="246"> <input
type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile"
type="file" id="userfile"> </td><td width="80"><input name="upload"
type="submit" class="box" id="upload" value=" Upload
"></td></tr></table></form>
What am I doing wrong? This is the way to set content on blob field?
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.