You can do it by properly setting the encoding type of the form, then creating an input with type of "file". On the action page, print_r $_FILES to see if it's working correctly. It should have uploaded the file to /tmp. Then use PHP's move_uploaded_file to put it where you want it. Save the new path and filename in the database.
There are quite a few tutorials around for file uploads but hopefully that will point you in the right direction. You won't need to create a separate model or anything. On Fri, May 8, 2009 at 10:26 PM, mike <[email protected]> wrote: > > I want to add a file upload to an existing form. I want to save the > file somewhere in the file system, and maybe save a reference to it in > the database. seems simple enough, but all the examples I've found > aren't exactly what I want. I don't want to create a whole different > model for the file upload. Can someone point me in the right > direction. > > Thanks. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
