w00t!!! File uploads work!!

For the past few days I learned how to write a Drupal module so I can support file uploads & downloads at shareyourmusic.com. I finally figured out why it wasn’t working.

The _form hook changed at some point. According to the documentation, it should be

function my_form(&$node, &$help, &$error)

After looking through the source code, I determined that it was actually being invoked as:

my_form(&$node, &$error, &$param)

In order to support file uploads, I had to add an option to $param specifying enctype=multipart/form-data. Once I got that straightened out, my module was able to properly locate the uploaded file. This was the biggest hurdle that kept me from opening the site.

Move complete

shareyourmusic.com is now running at PEHosting.com. I’m still trying to get the filestore module working. I’ve been working with the cvs version of drupal and learning how to modify the code.

Drupal test site

I’ve set up a Drupal test site for ShareYourMusic.com and I’m starting to like Drupal. It’s by far the most configurable and extensible system. There’s even a file upload module, which will provide the functionality I need.

Unfortunately I’m now dealing with 1and1’s suckage. I may end up hosting the site at PEHosting. 1and1’s control panel is the slowest & most limited I’ve ever used. They don’t even have phpMyAdmin. At least they do provide ssh access, but the only editor available is Vi – they don’t even have Pico. The real show-stopper for me is it looks like they don’t support local .htaccess, so I can’t set the required PHP options for Drupal. But hey, it’s free.

UPDATE: you can see the test site here. Note that you’ll see some error messages because the server isn’t properly configured.