Posted by pajoh on September 26, 2007 at 7:16pm
I am using Flex 2.0 and AMFPHP to access Drupal user services, and it has been going pretty smoothly. I've managed to create a couple simple user services on my own.
However, I am currently attempting to expand the user service module to allow uploading / changing the user picture. I am have more difficulty with this.
The following is my first stab at this and it doesn't work. I am hoping someone could point me in the right direction! Thanks!
function user_service_image( $source ) {
$info = image_get_info($source);
$file = file_check_upload( $source );
if ($file){
$filepath = variable_get('user_picture_path', 'pictures') .'/picture-'. $user->uid .'.'. $info['extension'];
$file = file_save_upload($file, $filepath, 1);
$user = array( 'picture' => $filepath );
$result = user_save('', $user);
return $file;
}
}
Comments
Update
I am looking for this tool also. Any luck getting it to work? Let me know by email - publisher at qctonline.com
proof of concept
I created a wiki page (http://groups.drupal.org/node/13781) with a proof of concept for file upload using flash 8 / drupal 6.