Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to transfer media files using Worklight

What's the correct way of transferring media (photos or movies) using Worklight Adapters?

I sent a photo via the adapter and got the error: form too large, exceed the maximum size... I read I need to change the form size through the Jetty

but the server I'll deploy the app won't be a jetty so what shell i do?
Thanks!

like image 998
A.B Avatar asked Dec 04 '25 15:12

A.B


2 Answers

Please see topic Uploading large (and binary) files to Worklight adapter.

Basically, Worklight does not have the equivalent to an HTTP POST mechanism that allows you to transfer arbitrarily large chunked data. For large files of unknown sizes (photos, video, audio) you'll need to upload the file to the server outside the Worklight adapter framework. For example you could simply post it to a web server you have configured. In my case (in the above referenced answer) I needed to create an entire client-server mechanism to negotiate a port and key, start listening on that port, then accept requests and ensure the posting client passes the key as authorization to transfer the secure data.

Hopefully IBM will provide a formal service for this in a future release.

like image 104
user2217751 Avatar answered Dec 09 '25 03:12

user2217751


Adapters do not work with html forms, they work with data. You will need to convert your image to base64 and submit as a adapter invocation parameter.

Having more information regarding what exactly you're trying to achieve might be helpful.

like image 38
Anton Avatar answered Dec 09 '25 03:12

Anton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!