Posted on: 2018/3/8 23:26
Re: Usage of fineupload
Someone was going to write up a howto, but I never saw it.
Here are examples of all of the pieces:
Handling the Upload
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.