Hi @lbpp
Check out the Attachments API (which is currently in the pipeline and should be available in the 2.3 release). As you’ll see, this kind of thing will be far easier going forward.
Hey @henrywright, thanks for your response!
This looks great, but it does not seem to be coming until the very soonest “end of May”. So I will assume June or July really. That kinda leaves me in a bind with this project. Any other suggestion for a solution with the current BP release? I feel I can’t be the only one that would have wanted this feature.
@lbpp OK so the short term approach would be to write a HTML form with the option list and file upload button as form elements. Then, server-side, you’d have your processing script which processes the $_POST data after the user has submitted.
There’s 101 ways to do that. Plupload springs to mind as the most elegant solution because you can do all sorts of stuff with the uploaded file (and of course Plupload is a core library so the solution will be lightweight). In terms of where the media gets uploaded to, I assume you’d want it to go into the back-end Media Library? If so, then checkout the async upload script. If you use that when setting your Plupload defaults, then most of the heavy lifting is done for you automatically.
Check out the Plupload docs for more info on that library.
Of course, that’s just one approach you could go with (the one I’d choose myself), but there will be many more alternative approaches you could take.
Great advice! I will look into these solutions. Would these plugins also tie into Buddypress well and get posted to Activity, notifications, etc?
Plupload isn’t a plugin, rather, it’s an ‘upload’ library used in WordPress core. It’s a great way of uploading media. We’ve all used it even though we might not know it because it’s the tool that powers the media uploading when you go to WP admin > Media > Add New
Oh, ahaha! Ok so I would have to find a way to hook into all the Buddypress functions then to have it actually incorporated into the BP experience.
You wouldn’t necessarily need to hook into BuddyPress functions. Instead, the main thing to do would be to upload the file, associate that file with a BuddyPress member, and record any associated data for that upload (the user’s choice from your option list).
Check out this article for getting started with Plupload:
http://www.plupload.com/docs/Getting-Started
Thanks for all the helpful advice Henry!