Alan,<div><br></div><div>File attachement was a controlled operation and needs to be enabled by module.</div><div><br></div><div><div>Generally, MODULENAME-&gt;save_module() should trigger the call to </div><div>CRMEntity-&gt;uploadAndSaveFile($id,$module,$files);</div>

<div><br></div><div>Look at modules/HelpDesk/HelpDesk.php</div><div><br></div><div>Let us know if it helps.</div><div><br>
Regards,</div><div>Prasad<br><br><div class="gmail_quote">On Mon, Jun 11, 2012 at 6:11 PM, Alan Lord (News) <span dir="ltr">&lt;<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m creating a new module for a client using vtlib.<br>
<br>
We need to have a field in that module that will allow a user to attach<br>
an image or other file.<br>
<br>
There seem to be several possible UI types, 27/28, 61, 69, 105 &amp; 107,<br>
none of which work in my tests.<br>
<br>
I also tried creating a UI type 10 field and<br>
setRelatedModules(array(&#39;Documents&#39;)) so the user could instead select a<br>
specific attachment already created and saved in the Document module,<br>
but this doesn&#39;t work either. The popup allows me to select the document<br>
but on save the field is always empty and nothing is being stored in the<br>
new modules database.<br>
<br>
The forums are littered with requests with this functionality but no<br>
conclusive answers...<br>
<br>
What is the right way to do what I, and many others, need?<br>
<br>
Thanks in advance<br>
<span class="HOEnZb"><font color="#888888"><br>
Al<br>
<br>
--<br>
Libertus Solutions<br>
<a href="http://www.libertus.co.uk" target="_blank">http://www.libertus.co.uk</a><br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</font></span></blockquote></div><br></div></div>