Using the API to add attachments to a candidate record

20 views
Skip to first unread message

Cindy LTI

unread,
Aug 25, 2016, 10:24:10 AM8/25/16
to CATS API
I am using the API to upload a file to the candidate record in CATS,

        $file = realpath('../public/uploads/'.$_SESSION['userid'].'_score.csv');

This is working great in the production environment but I am testing a new version of WAMP using identical PHP code from production in a new test environment and am receiving an error.
The error is code 412 with no file being uploaded and I believe that the 412 error is for precondition not met. Trying to find out what precondition I am missing in the test environment. 


FYI, 
Another API call is working fine, so I believe this is only affecting file uploads. 
         $api->update_candidate($_SESSION['userid'],$finalvalue,'','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''); 

Aaron Baluczynski

unread,
Aug 25, 2016, 10:26:34 AM8/25/16
to CATS API
Hi Cindy,

That sounds like a file permissions issue on your server.

Aaron

Cindy LTI

unread,
Aug 25, 2016, 10:52:56 AM8/25/16
to CATS API
I actually have the new WAMP and PHP set up on my PC for testing I am an admin for the PC so I believe I have permissions to every directory and file.  Is there something I can check?  

I have used the API call from the http://api.catsone.com/api/add_attachment site and am able to upload the same file through this method from my PC. 

Aaron Baluczynski

unread,
Aug 25, 2016, 10:55:29 AM8/25/16
to CATS API
The web server that you are using (e.g. apache, nginx) must have permission to access the files.

Cindy LTI

unread,
Aug 30, 2016, 3:51:59 PM8/30/16
to CATS API
Do you have any suggestions on how to find and change these permissions?  I am using apache as part of a WAMP server on a Windows 7 PC.  I have been trying everything I can find or think of. Thanks!
Reply all
Reply to author
Forward
0 new messages