Welcome Guest   |   Member List
Username Remember Me?
Password   forgot password?
 
   
 
Image for avatar upload location?
Posted: 28 March 2012 08:09 PM   [ Ignore ]  
Newbie
Rank
Total Posts:  1
Joined  2012-03-27

Can someone help with this? I am new to Fellowship One API and I have searched the Forums and Docs for this with no luck.
/path/to/directory/ for image upload.
I am wanting to use the “Enter Visitor Data via Your Church Website” script.
This script has been tested and works flawlessly. My only trouble is the image upload.
Many thanks in advanced. Have a blessed day.

//Check if a file was uploaded and move it out of the temp directory then write it to F1

  if ($_FILES[‘image’][‘name’]){
      define(‘UPLOAD_DIR’, ‘/path/to/directory/’);
      move_uploaded_file($_FILES[‘image’][‘tmp_name’], UPLOAD_DIR.$_FILES[‘image’][‘name’]);
      $imageStr = file_get_contents(UPLOAD_DIR.$_FILES[‘image’][‘name’]);
      $r = $f1->createImage($imageStr, $personID);
  }

Profile
 
 
Posted: 29 March 2012 07:56 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  282
Joined  2009-09-21

This section of the script is defining the path where the image is stored temporarily.  If you are using a local test environment, that path might look like this for example:

Windows:

define ('UPLOAD_DIR''c:/images/'); 

Mac:

define ('UPLOAD_DIR',  'Users/username/images/'); 

If you are using a remote server, you will need to create a directory on your server to hold the image, then get the path and also make sure the directory has the appropriate permissions.

Profile
 
 
Posted: 21 April 2012 01:34 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  2
Joined  2012-03-23

Thank you Tracy. Your responce was perfect.

Profile
 
 
Posted: 23 April 2012 07:33 AM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  282
Joined  2009-09-21

You’re welcome!

Profile