Using core modules... what's the easiest way to insert a file upload field into a new node type? I can get the field to show up with

form_file(t('Upload group image'), $group_picture, 48, t("Upload an image to represent your group."));

but the uploading doesn't work.
Thanks,
Billy

Comments

tangent’s picture

Have you tried adding 'file attachments' to the node type you want them added to?

In Drupal 4.6
Administer > Content > Configure > Default Workflow
or
?q=admin/node/configure/defaults

jeepfreak’s picture

Yeah, that's a very good point, but I'd like to avoid it if possible. I only want them to be able to upload 1 file/image and I'll run a few verifications to make sure it is what I want, therefor I think doing it how you suggest would complicate things unnecessarily.
Thanks,
Billy

jeepfreak’s picture

Anybody know? I'm approaching 30 lines of code writing it myself... there has got to be an easier way!

jeepfreak’s picture

Never got it to work =(

jeepfreak’s picture

STILL can't get it working. I just want to be able to upload 1 file during node creation and store that file's location in my db table.

I don't even know where to put the code in example_node.module... what hook??? Do I create a button seperate from "Submit" on the node creation page???

People, please share you're thoughts... even if you're not an expert... maybe you can still help me figure this out.
Thanks,
Billy