CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Solved : Can't seem to get custom file field to store location of file.
Pages: [1]

Author Topic: Solved : Can't seem to get custom file field to store location of file.  (Read 504 times)

SweetTooth

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 1
  • CiviCRM version: 4.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Solved : Can't seem to get custom file field to store location of file.
January 21, 2013, 06:38:17 pm
I'm on Drupal 6.2.xx and Civicrm 4.1.6


$params = array(
'contact_id' => '123',
'contact_type' => 'Individual',
'version' => '3',
'custom_72' => './sites/default/files/civicrm/custom/filetest1.jpg' ,  );
   
$result = civicrm_api( 'contact','create',$params );

The above will just send me to the front page of my website.

This is the warning I get about it in the log.

PHP Warning:  rename(.,/var/www/html/sites/default/files/civicrm/custom/.): Device or resource busy in /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php on line 1669, referer: https://xxxxx.com/xxxxxxx
[
   
 :(

Also, the API is being bootsrapped no problem - I can even update other custom fields etc - it's when I hit this particular file custom field that I run into problems.



Does anyone have an exact working example of how to put a file path into a custom file field please?

Many thanks.
« Last Edit: January 22, 2013, 03:51:59 pm by SweetTooth »

SweetTooth

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 1
  • CiviCRM version: 4.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Solved : Re: Can't seem to get custom file field to store location of file.
January 22, 2013, 03:51:36 pm

OK...silly me...if I had just uploaded a file manually and then did a "GET" to retrieve the record...then see what it says!

 ;D

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Solved : Can't seem to get custom file field to store location of file.

This forum was archived on 2017-11-26.