Answers.Body: <p>Try using the <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/API+changes#APIchanges-4.6.0:AttachmentAPI" rel="nofollow">attachment api</a>, it will handle the nitty-gritty for you.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-11T09:21:41.000Z
Answers.Text: I cannot find any examples of the attachment api - and no documentation either apart from your link.  Can you suggest where to look for an example of this api being used in Civi?  Thanks
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-11T12:08:30.533Z
Answers.Text: In the 4.6+ api explorer (use the demo server if you haven't upgraded) go to the "Code Docs" tab and look it up.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T17:59:40.353Z
Answers.LastActivityDate: 2015-08-06T17:59:40.353Z
Answers.UserDisplayName: Coleman
Body: <p>I want to import many pdfs into Civi and so need to make the link between the uploaded pdf and the database table.  I used the UI to upload a sample pdf (calke_walk.pdf) and looking at the db table, the field in question contains an int(10) unsigned   with a value of 8.  The uploaded pdf has a file name of Calke_walk_a0e8f5791bb72c5b53c253f4fa66fd2f.pdf    In Civi's UI the file has a url that ends with &amp;id=8&amp;eid=28308  The clue there is the &amp;id=8 I guess, but is there more to this that I need to know?</p>
  
Tags: <pdf>
Title: How does CiviCRM make the link between uploaded pdfs and the database table?
ThreadText: # How does CiviCRM make the link between uploaded pdfs and the database table?
  
  (Asked by: username_0 on 2015-08-06)
  
  I want to import many pdfs into Civi and so need to make the link between the uploaded pdf and the database table. I used the UI to upload a sample pdf (calke\_walk.pdf) and looking at the db table, the field in question contains an int(10) unsigned with a value of 8. The uploaded pdf has a file name of Calke\_walk\_a0e8f5791bb72c5b53c253f4fa66fd2f.pdf In Civi's UI the file has a url that ends with &id=8&eid=28308 The clue there is the &id=8 I guess, but is there more to this that I need to know?
  
  **Tags:** pdf
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-08-06. Score: 2
  
  Try using the [attachment api](http://wiki.civicrm.org/confluence/display/CRMDOC/API+changes#APIchanges-4.6.0:AttachmentAPI), it will handle the nitty-gritty for you.
  
  > **Comments:**
  > **username_0**: I cannot find any examples of the attachment api - and no documentation either apart from your link.  Can you suggest where to look for an example of this api being used in Civi?  Thanks  
  > **username_1**: In the 4.6+ api explorer (use the demo server if you haven't upgraded) go to the "Code Docs" tab and look it up.  
  
  ---
  
  