diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-17 19:14:42 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-17 19:14:42 +0000 |
commit | b41323642bffd3761f73a8c9dc8260546d7533f1 (patch) | |
tree | 1a0530685d18eb01e0356fbed7de91aba00405e9 /modules/blogapi/blogapi.module | |
parent | 0138e3946ab2458ffb97066d4b8a0cd94d83e516 (diff) | |
download | brdo-b41323642bffd3761f73a8c9dc8260546d7533f1.tar.gz brdo-b41323642bffd3761f73a8c9dc8260546d7533f1.tar.bz2 |
#517814 by jmstacey, justinrandell, pwolanin, drewish, Jody Lynn, aaron, dopry, and c960657: Converted File API to stream wrappers, for enhanced private/public file handling, and the ability to reference other storage mechanisms such as s3:// and flicker://.
Diffstat (limited to 'modules/blogapi/blogapi.module')
-rw-r--r-- | modules/blogapi/blogapi.module | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module index 17a0071f5..5a6ab9efe 100644 --- a/modules/blogapi/blogapi.module +++ b/modules/blogapi/blogapi.module @@ -460,19 +460,23 @@ function blogapi_metaweblog_new_media_object($blogid, $username, $password, $fil $filename .= '.' . $final_extension; } + else { + $filename = $name; + } + $uri = file_build_uri($filename); $data = $file['bits']; if (!$data) { return blogapi_error(t('No file sent.')); } - if (!$file = file_unmanaged_save_data($data, $filename)) { + if (!$file = file_unmanaged_save_data($data, $uri)) { return blogapi_error(t('Error storing file.')); } $row = new stdClass(); $row->uid = $user->uid; - $row->filepath = $file; + $row->uri = $file; $row->filesize = $filesize; drupal_write_record('blogapi_files', $row); |