jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

Access file name before save() in File_Field #123

Closed dyip closed 14 years ago

dyip commented 14 years ago

Sorry if this question has been asked before but, I would like to create a thumbnail from an uploaded image but I can not find a way to access the uploaded file in File_Field before saved() is called.

For example, we have a table:

create table images( id primary key, image_name varchar(127) <----where File_Field is, thumbnail_name varchar(127), ... );

So if I want to create a thumbnail from the uploaded image, I have to call save() the image object once, and then once I have the filename, create the thumbnail and save the image object again?

jonathangeiger commented 14 years ago

You'd probably be better of creating your own field for this. Let me know if you need help or post a topic on the forums. If you're interested in working on a Image or Thumbnail field let me know because I'd be interested in getting it into core.

jonathangeiger commented 14 years ago

Gonna try and get this fixed by 1.0.

jonathangeiger commented 14 years ago

This should be fixed now in 1.0. Uploading is done when validation is performed and the new filename is set on the field before save() is ever called.