[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtigercrm-developers
Subject:    Re: [Vtigercrm-developers] Vtiger 7.1 RC Released
From:       nilay khatri <nilay.spartan () gmail ! com>
Date:       2018-02-01 11:45:42
Message-ID: CAFJh29wPEELHVJf-jrzPgvdBxv3LDvrTaZ566RypTxM5KNbF4Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Agree.

It should also support for the file fields in modules such as contact and
Product.

Quite feasible if the file could be sent in API request as Base64 encoded
value.

regards,
Nilay Khatri
Founder, Automate SMB
*Vtiger CRM implementation/Customization | Sales and Marketing Automation *


On Thu, Feb 1, 2018 at 4:49 PM, Alan Lord <alanslists@gmail.com> wrote:

> This is rather interesting...
>
> By the looks of the WebFormsModel, the WebServices API itself should now
> support the creation of Document records _with_ file attachments.
>
> Can you confirm this?
>
> Can you provide an example of how to do this?
>
> I can't see where you are retrieving the actual contents of the file, i.e.
> $_FILES['filename'][tmp_name]?
>
> I can't see where you are checking the mime_type either.
>
> It looks like you are using the $_FILES super-global so this implies (I
> think) that the file must be POSTed to the server for it to be available.
> Could we use this with the "server api", e.g. local calls to vtws_...
> functions? These calls don't use POST do they?
>
>
> Thanks
>
> Al
>
>
> $uploadedFiles = $_FILES;
>> foreach ($uploadedFiles as $fileFieldName => $uploadedFile) {
>>     if (in_array($fileFieldName, $fileFieldsNameArray) &&
>> $uploadedFile['error'] == 0 && $uploadedFile['name']) {
>>                                         $data['notes_title'] =
>> $fileFieldsArray[$fileFieldName];
>>                                         $data['document_source'] =
>> 'Vtiger';
>>                                         $data['filename'] =
>> $uploadedFile['name'];
>>                                         $data['filelocationtype'] = 'I';
>>                                         $data['source'] = 'WEBFORM';
>>                                         $data['assigned_user_id'] =
>> $wsRecord['assigned_user_id'];
>>                                         $data['filestatus'] = 1;
>>                                         unset($_FILES);
>>                                         $_FILES['filename'] =
>> $uploadedFile;
>>                                         $record =
>> vtws_create('Documents', $data, $current_user); *<-- Here *
>>                                         array_push($createdDocumentRecords,
>> $record['id']);
>>                                 }
>>
>
>
> On 08/01/18 09:53, Satish Dvnk wrote:
>
>> Hi All,
>>
>> We would like to update you that Vtiger community edition *V7.1 RC* has
>> been published in sourceforge.net
>>
>
>  3. *Webform Attachments *(Allow user to attach files to web forms)
>>
>
> _______________________________________________
> http://www.vtiger.com/
>

[Attachment #5 (text/html)]

<div dir="ltr">Agree.<div><br></div><div>It should also support for the file fields \
in modules such as contact and Product.</div><div><br></div><div>Quite feasible if \
the file could be sent in API request as Base64 encoded value.</div></div><div \
class="gmail_extra"><br clear="all"><div><div class="gmail_signature" \
data-smartmail="gmail_signature"><div dir="ltr"><div><div \
dir="ltr">regards,<div>Nilay Khatri</div><div>Founder, Automate SMB</div><div><i \
style="font-size:x-small">Vtiger CRM implementation/Customization | Sales and \
Marketing Automation  </i><br></div><div><br></div></div></div></div></div></div> \
<br><div class="gmail_quote">On Thu, Feb 1, 2018 at 4:49 PM, Alan Lord <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">This is rather interesting...<br> <br>
By the looks of the WebFormsModel, the WebServices API itself should now support the \
creation of Document records _with_ file attachments.<br> <br>
Can you confirm this?<br>
<br>
Can you provide an example of how to do this?<br>
<br>
I can&#39;t see where you are retrieving the actual contents of the file, i.e. \
$_FILES[&#39;filename&#39;][tmp_name]?<br> <br>
I can&#39;t see where you are checking the mime_type either.<br>
<br>
It looks like you are using the $_FILES super-global so this implies (I think) that \
the file must be POSTed to the server for it to be available. Could we use this with \
the &quot;server api&quot;, e.g. local calls to vtws_... functions? These calls \
don&#39;t use POST do they?<br> <br>
<br>
Thanks<br>
<br>
Al<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> $uploadedFiles = $_FILES;<br>
foreach ($uploadedFiles as $fileFieldName =&gt; $uploadedFile) {<br>
      if (in_array($fileFieldName, $fileFieldsNameArray) &amp;&amp; \
                $uploadedFile[&#39;error&#39;] == 0 &amp;&amp; \
                $uploadedFile[&#39;name&#39;]) {<br>
                                                            \
                $data[&#39;notes_title&#39;] = \
                $fileFieldsArray[$fileFieldNam<wbr>e];<br>
                                                            \
                $data[&#39;document_source&#39;] = &#39;Vtiger&#39;;<br>
                                                            $data[&#39;filename&#39;] \
                = $uploadedFile[&#39;name&#39;];<br>
                                                            \
                $data[&#39;filelocationtype&#39;] = &#39;I&#39;;<br>
                                                            $data[&#39;source&#39;] = \
                &#39;WEBFORM&#39;;<br>
                                                            \
                $data[&#39;assigned_user_id&#39;] = \
                $wsRecord[&#39;assigned_user_id&#39;];<br>
                                                            \
                $data[&#39;filestatus&#39;] = 1;<br>
                                                            unset($_FILES);<br>
                                                            \
                $_FILES[&#39;filename&#39;] = $uploadedFile;<br>
                                                            $record = \
                vtws_create(&#39;Documents&#39;, $data, $current_user); *&lt;-- Here \
                *<br>
                                                            \
array_push($createdDocumentRec<wbr>ords, $record[&#39;id&#39;]);<br>  }<br>
</blockquote><span class="">
<br>
<br>
On 08/01/18 09:53, Satish Dvnk wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Hi All,<br>
<br>
We would like to update you that Vtiger community edition *V7.1 RC* has been \
published in <a href="http://sourceforge.net" rel="noreferrer" \
target="_blank">sourceforge.net</a> <br> </blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">  3. *Webform Attachments *(Allow user to attach files to web \
forms)<br> </blockquote>
<br>
______________________________<wbr>_________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" \
target="_blank">http://www.vtiger.com/</a><br> </blockquote></div><br></div>



_______________________________________________
http://www.vtiger.com/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic