Someone was going to write up a howto, but I never saw it.
Here are examples of all of the pieces:
Initialize fineuploader
- htdocs/modules/system/admin/avatars/main.php
- htdocs/modules/system/templates/admin/system_avatars.tpl
Handling the Upload
- htdocs/ajaxfineupload.php
- htdocs/modules/system/class/fineuploadhandler.php
- htdocs/modules/system/class/fineavataruploadhandler.php
In the initialize phase, your code sets up the javascript front end the user interacts with.
The existing uses in XOOPS assign variables used a Smarty template to build the JS code.
One of your code's major responsibilities is to build the JSON Web Token that is used in
authorization for any uploading and controls the handling of the uploaded file(s).
The payload for the JWT needs to have these claims.
'aud' => 'ajaxfineupload.php', // program to process the token (audience)
'uid' => $user, // what user can use this token
'handler' => 'fineavataruploadhandler', // handler class that will store the file
'moddir' => 'system', // module handler belongs to
Any other information you might need to pass to your handler can be added to the token.
On the upload, the ajaxfineupload.php is a generic endpoint that handles the upload process,
including security, i.e. verifing the claims. It then loads the specified handler class, giving
it access to the claim data and the file to be stored. The handler should take care of any
additional needs like database entries to identify the upload.
I hope this helps.