Hi everybody

Trying to use the stuff from Andy, more specific his UploadBehavior. I
started out with http://www.ad7six.com/MiBlog/GenericFileUploadBehavior,
but moved over to checking out http://trac.assembla.com/mi/browser/branches/base
as the code there seemed more polished and 1.2-ish.

My first task is to upload and attach documents (not images) to one of
my models, so, I have these files (just for reference really):

http://trac.assembla.com/mi/browser/branches/base/models/behaviors/upload.php
and its dependencies (slugged and polymorphic).

As the model for my attached documents, I use
http://trac.assembla.com/mi/browser/branches/base/models/attachment.php
(just changed the Belongs to to the name of my user model).

Then, I have the attachments controller:
http://trac.assembla.com/mi/browser/branches/base/controllers/attachments_controller.php

I think that's all the files, yeah, plus the views for attachment as
well.

Uploading and associating works great, using /admin/attachments/add/
Model/1 for example, the problem I have is serving up the documents, I
don't quite understand how to do this.

http://trac.assembla.com/mi/browser/branches/base/controllers/attachments_controller.php#L259
shows the function for doing this, problem is that this only works
with images, not documents? Line 306 checks for the filename and _
$size, which doesn't exist when uploading files, thus it never finds
the file. In the "old" files (Generic Upload Behavior), /files was
routed to view with size set to "Original" if I remember correctly,
but I can't see how to do that with this new code.

Anyone?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to