Hi
I'm trying to create a file upload plugin for user profile field.
I'm saving the uploaded file by "file_save_draft_area_files" but when I check database's "files" table there is both saved and draft entries and the draft is not removed!
Also I can't findout how to get aved file data from "file_save_draft_area_files" to be able to serve it to user in "display_data"
My field.clas.php attached.
Can anyone help me with the Upload, Save & Serve process of a file in user profile field?
Thanks
Hi
draft is not removed
Correct. That's expected behaviour. IIRC, there is a garbage collector that cleans old draft areas later (sorry, away from my notebook now, can't check the code).
WRT the file serving, have you checked http://docs.moodle.org/dev/File_API ?