[Vtigercrm-developers] Vtiger 7.1 RC Released
Alan Lord
alanslists at gmail.com
Thu Feb 1 11:19:30 GMT 2018
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)
More information about the vtigercrm-developers
mailing list