Case Attachments

I have been trying to attach files to cases through case attachments button. The files are not attaching and from what I can see, they are not even writing to the database. I have attached a screen shot of the data base. Any thoughts?

Hi, scsteffes

assuming you are attaching files by clicking “Create note or attachment” under “History” and then selecting the file and saving, a new line for this note should appear under History.

If you click on the paperclip symbol in this line, then you should be able to download the file.

The files generally are not saved in the database. However, if you export from the Notes module (that is the related module in which attachment information is saved), then there is a column called “Attachment”, which shows the uploaded file name.

Actually I am not using the history tab. When you use cases you have the ability to attach files right at the case level. This is where it is not writing to the DB. See screenshot

Hi,

you might want to check if you are able to add attachments under history.

You might also want to check for errors in

suitecrm.log

or the error log of your webserver, typically one of the following on linux/bsd:

/var/log/httpd-error.log
/var/log/apache2/error.log

Thanks, I can add them in the history section. We checked the log, there isn’t anything in the logs about Case Files.

Here is what is written to the Log when I try to attach a doc to Case

[10-Aug-2015 13:44:41 America/Chicago] PHP Notice: Undefined variable: emails in C:\inetpub\wwwroot\suitecrm\modules\AOP_Case_Updates\AOP_Case_Updates.php on line 81
[10-Aug-2015 13:44:41 America/Chicago] PHP Notice: Undefined index: case_update_file in C:\inetpub\wwwroot\suitecrm\modules\AOP_Case_Updates\CaseUpdatesHook.php on line 46
[10-Aug-2015 13:44:41 America/Chicago] PHP Warning: Invalid argument supplied for foreach() in C:\inetpub\wwwroot\suitecrm\modules\AOP_Case_Updates\CaseUpdatesHook.php on line 46
[1:48:35 PM] TJ -

Hi,

according to the last error the $_FILES variable, that should list the information about the uploaded file, is empty. In the following link some solutions are listed for this issue:

http://stackoverflow.com/questions/3586919/why-would-files-be-empty-when-uploading-files-to-php

I would especially pay attention to the check-list nr. 1 and nr. 4 .

Make sure you restart your webserver (apache/nginx) after modifying php.ini

Just checked -

  1. File uploads is on and set to 50M and post_max_size 50M too
  2. Proper read/write permissions are given to upload_tmp_dir

No luck. Still same error in PHP error log as above.

Any thoughts?

  1. File uploads is on and set to 50M and post_max_size 50M too
  2. Proper read/write permissions are given to upload_tmp_dir

No luck. Still same error in PHP error log as above.

I found what we need to change, but I don’t know where to go in the suitecrm install to make this change properly…

See the attachment. When I add the attribute enctype= “multipart/form-data” to this form element then the file uploads properly.

Any direction on what file i need to edit to add this?

Dug through some old posts and found a solution:

I added the following to /custom/modules/Cases/metadata/editviewdefs.php

    'form' =>
  array (
     'enctype' => 'multipart/form-data',     //you have to add this thing in ur code.
  ),
    5 =>
    array (
      0 =>
      array (
        'name' => 'filename',
        'comment' => 'File name associated with the note (attachment)',
        'label' => 'LBL_FILENAME',
      ),
    ),

https://suitecrm.com/forum/suitecrm-7-0-discussion/2186-image-field-type

Hi,

this change is already been implemented from SuiteCRM version 7.2.2

In case you have upgraded from an earlier SuiteCRM version and previously made customizations to your Cases EditView layout, then:

  • go into studio, module Cases, layout EditView and throw away your customizations by clicking “Restore Default”
  • rebuild your custom EditView layout