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

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


Hi

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?

2
geekwright
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.

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

  • goffy

  • Just can't stay away

  • Posts: 543

  • 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

Login

Who's Online

332 user(s) are online (207 user(s) are browsing Support Forums)


Members: 0


Guests: 332


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits