delete

Adding eBook epub and mobi downloads to WordPress

A few technical notes if you want to add ebooks (.epub and .mobi file formats) downloads to your wordpress site. We encountered three obstacles, file size, upload restrictions and file association. Here are the solutions.

WordPress File Size Limits are Too Low

WordPress by default only allows 2 meg uploads and only of particular file types. Unfortunately .epub and .mobi are not among the default file types that are allowed by WordPress.

First the bad news – if you want to increase the allowed file sizes for uploads you have to modify the php.ini file. Depending on your hosting provider this may or may not be easy. See Bill Erickson’s post on increasing allowed file uploads in WordPress.

File Types That can be uploaded in WordPress

Hopefully this will change, but currently .mobi and .epub are obscure. So you have to configure WordPress to allow them on most hosting providers.

We are running the WordPress Thesis theme on this particular site so the solution to add file types for upload was found here and is abbreviated below.

In the Thesis custom_functions.php file add this php code using the WordPress editor. But don’t make a typo as after that you would have to FTP in to fix it. Hypothetically speaking. Here is the function modified from the link above.

function addUploadMimes($mimes) {
    $mimes = array_merge($mimes, array(
        'epub|mobi' => 'application/octet-stream'
    ));
    return $mimes;
}
add_filter('upload_mimes', 'addUploadMimes');

The above example only includes the .epub and .mobi examples, but if you want more just pipe-filetype further where the code says ‘epub|mobi’.

Change the Content-Type for epub Files Served by Apache and WordPress

All fixed, right? Not so fast. WordPress serves unknown files with the content-type of “Content-Type text/plain” in the HTTP header. You can see this using theĀ excellent long-lasting Rex Swain HTTP viewer.

The problem is that while Windows handles the misidentified .epub files fine, Macs freak out and show you the binary. You click it on a Mac and see garbage. Not cool. Must fix.

I found this post in the WebFaction support on adding epub to the .htaccess file to change content-type by file extension. A bit of modification and I found adding this to the application root .htaccess file did the trick

AddType application/epub+zip .epub
AddType application/x-mobipocket-ebook .mobi

A word of caution – BE CAREFUL WITH YOUR HTACCESS file! It probably already exists so be sure to download-backup-modify-upload-via-ssh for maximum security. Or really sFTP is plenty secure as well.

Other epub and mobi pit-falls to look out for

The ePub must be strictly validated. it is really a Zip compressed directory with it’s own MIME type specification. And XML that must be valid. Google “epub validation” if the above list did not solve your problem and go from there.

delete

How to Wipe a Blackberry Clean

I had trouble figuring this out, so here goes. To completely wipe your blackberry clean varies by device. But it can be done. I had a 7100 series and the steps are:

  1. Settings (looks like a folder with gears on the top right)
  2. Options (just has two gears)
  3. Security Options – select this from the visible menu by scrolling down
  4. General Settings – select this from the visible menu by scrolling down
  5. << Press Scroll Wheel in >> – this shows a scroll wheel menu
  6. On the resulting scroll wheel menu there is an option to "wipe handheld" – That is what you want.

I mention this because several places on the interwebs told me to go to options and select "wipe handheld" but of course this ONLY shows up for this particular device in a scroll wheel menu.

Other sources (clear blackberry) and (blackberry faq)

delete

Shelly Palmer does NOT like the iPhone

See "iPhone Reality/Sanity Check – my iWish list" – Shelly sort of doesn’t like it.

And I confess. Yes I bought an iPhone. No, I did *not* port my number and I am still carrying my blackberry. I got burned so bad on a craptacular windows mobile unit from HP a while back that I was wary this time. Apparently that was a good thing. And everyone is enjoying borrowing the iPhone for a few days at a time to test web sites with and such.

delete

iPhone Development PPT Uploaded to SlideShare

It is exactly two days past iPhoneDevCamp in sunny San Francisco. Given we did not have a speaker scheduled for Netsquared Houston tonight (we do for the next three months, just not tonight) I took the opportunity to put together a developers introduction to the iPhone. The slides were just posted to slideshare. And here they are (much better with a presenter).

Please consider these creative commons with attribution. Yes use the iPhone Developer Training PPT, please do give credit and share the improvements you make. Thanks! – Ed

delete

Adobe Hosting iPhoneDevCamp


  Adobe Hosting iPhoneDevCamp 
  Originally uploaded by eschipul

In San Fran for iPhoneWebDev version of BarCamp. Barcamp is a self organized conference. To put this in perspective. To explain the power of social software tools. This iPhone conference with 400 people in attendance was organized by volunteers in a three week period.

Let me repeat that – three volunteers started a process that resulted in corporate sponsorships and over 400 attendees with no money and only social software tools.

I’ll keep posting as things progress. It should be interesting if a bit intimidating.

delete

iPhoneDevCamp in San Francisco – yea!

Headed to San Francisco this morning for BarCamp and mainly the iPhone Developers Camp. iPhoneDevCamp Attendees over 325 at the moment and the Adobe Guest wireless supports 200. And oh ya, all of us will have wifi enabled iPhones to make that a 640-200=440 deficit. Oh THIS is going to work. But hey, with all of those innovators in the room we will come up with something.

Resources read, cached on the browser or printed are:

  1. Select iPhoneDevCamp wiki pages
  2. iPhone Developers Guide from Apple
  3. iPhoney emulator installed on the MacBook
  4. I am *not* installing WebKit as I am counting on Safari to do that for me.
  5. Installed Aptana web dev IDE on the Mac. This is new to me but it has an iPhone plugin so I am going to test it a bit.
  6. Looked up how to reboot the iPhone. Hold "home" button (bottom front) and "sleep" button (top of phone) down for 8 seconds.

A couple of other iPhone thoughts on this and social software. First note the graphics from Apple on the developers guide. The iPhone is a view port and it doesn’t have "windows" – it just has a view port.

It does not support Flash or Java Packages as far as I can tell. So fly out navigation appears to be a serious issue. Will learn about that at camp I suppose, but I do know our nav is not working on the iPhone. Luckily we have a sitemap, but we need a more prominent link to it.

Note the barcamp wiki is locked down for edits on any page besides attendees. I have ranted on this before, the point is that complete freedom on the Internets (heh) quickly attracts spam links. Attacks are part of the system. Just noting a common theme that goes against what we verbally talk about. Wikis are great if moderated in some fashion IMHO.

And now for another quick trip to San Fran. Hopefully Continental will bump me again!