Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
This patch should use the file system functionality exported by file.inc. Storing uploaded files to /tmp is not a practical nor a durable solution. Take a look at how the project module manages file uploads, or how the profile module handles avatars.
well, it does use the file api for the parts that the file api supports. however, the file is not received via an http upload ... it is base64 encoded in the xmlrpc call -- meaning we need to create the file from a string. this patch honours file.inc's temp dir setting to temporarily store the file, then uses file_move() to put it in the proper location. it will not work directly with file.inc until file.inc has something like: file_save($dest, $data).
Verified that this patch works as advertised. I used Ecto on OSX in my test.
Authoring with a desktop app is a pleasure. You get easy WYSIWYG interface, spellcheck, offline authoring, and with this patch, you effortlessly add images.
well... it only took a couple months. but here is a revamped patch that does two things:
1) adds a file_save_data() function to file.inc -- that creates a file using a string of file contents. file_save_data creates a temp file from the string, then uses file_move() to move it to its destination to take advantage of the file collision code and other checks in file_copy().
2) uses said function to store the submitted file from newMediaObject() in blogapi.module.
this patch should also perhaps be backported for a 4.4.2 release?
Comments
Comment #1
walkah commentedComment #2
walkah commentedThis patch implements metaweblog's newMediaObject method.
Comment #3
dries commentedThis patch should use the file system functionality exported by
file.inc. Storing uploaded files to/tmpis not a practical nor a durable solution. Take a look at how the project module manages file uploads, or how the profile module handles avatars.Comment #4
walkah commentedwell, it does use the file api for the parts that the file api supports. however, the file is not received via an http upload ... it is base64 encoded in the xmlrpc call -- meaning we need to create the file from a string. this patch honours file.inc's temp dir setting to temporarily store the file, then uses file_move() to put it in the proper location. it will not work directly with file.inc until file.inc has something like: file_save($dest, $data).
Comment #5
moshe weitzman commentedchanging this to 'patch' status since it already implements as much of the file api as possible.
side note: w.bloggar doesn't support newMediaObject AFAICT.
Comment #6
moshe weitzman commentedVerified that this patch works as advertised. I used Ecto on OSX in my test.
Authoring with a desktop app is a pleasure. You get easy WYSIWYG interface, spellcheck, offline authoring, and with this patch, you effortlessly add images.
+1
Comment #7
boris mann commentedCan we get this added to 4.4 and HEAD?
For 4.5, I'd like to see it integrated with whatever-image-module-we-pick and probably filestore as well, but this is a very good interim solution.
Comment #8
skip commented+10... I just started using NetNewsWire to post and this was the first thing I wanted to do.
Comment #9
dries commentedAwaiting a better patch.
Comment #10
walkah commentedwell... it only took a couple months. but here is a revamped patch that does two things:
1) adds a file_save_data() function to file.inc -- that creates a file using a string of file contents. file_save_data creates a temp file from the string, then uses file_move() to move it to its destination to take advantage of the file collision code and other checks in file_copy().
2) uses said function to store the submitted file from newMediaObject() in blogapi.module.
this patch should also perhaps be backported for a 4.4.2 release?
Comment #11
killes@www.drop.org commentedI think this patch can be usefull for mailhandled content as well, so I am all for including it in core.
Comment #12
drummSomething like the old style module and polder theme could be done by writing stylesheets. Or a filesystem, instead of db, cache.
Comment #13
Kjartan commentedComment #14
(not verified) commented