Usage of fineupload
  • 2018/3/7 8:16

  • goffy

  • Just can't stay away

  • Posts: 532

  • Since: 2010/12/27


I realized that xoops now includes fineupload (https://fineuploader.com)

I'm playing a little bit around with that, but I don't get it working.

Is there somewhere an example, how I can add a drag&drop area to my module template and how I can then handle the uploads?

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:

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.

Re: Usage of fineupload
  • 2018/3/10 7:02

  • goffy

  • Just can't stay away

  • Posts: 532

  • Since: 2010/12/27

hi geekwright

thank you for explanation. I will try to find out what is going on there
and I hope I can present the results soon


Who's Online

160 user(s) are online (39 user(s) are browsing Support Forums)

Members: 0

Guests: 160



Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits