Upload image array?

Options
Hello,

I am trying to write an API call that allows attaching mutiple images in an array. 

Following tutorials but getting a weird reply and the test/debug only allows one image ulpoad?

an anyone help?

Whoops! An error occurred.
Exception: Jose\Component\Encryption\Serializer\CompactSerializer::unserialize(): Argument #1 ($input) must be of type string, array given, called in /xano/bin/includes/xano/context/JWE.php on line 107
[image.png][image.png]

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hey  you'll need to create the image from file For Each Item in your list (using a For Each Loop)... along with storing each in an array before adding to your database. Here's an example of doing exactly that:

    
  • Jeff Strang
    Jeff Strang Member
    edited July 2023
    Options

    Hi @Michael Udinski , I'm have the same error with a video blob. Do you have that example mentioned above?

  • Jeff Strang
    Jeff Strang Member
    Options

    Hi @Michael Udinski,

    To add more detail, the input data is:

    {name: Video Name, videoFile: {name, size, type, error, tmp_name, full_path},video-metadata: {"path":"string","name":"mediarecorder.webm","type":"video/webm","size":1320809,"mime":"video/webm","meta":{}}}

    The error message is:

    Jose\Component\Encryption\Serializer\CompactSerializer::unserialize(): Argument #1 ($input) must be of type string, array given, called in /xano/bin/includes/xano/context/JWE.php on line 107

  • Jeff Strang
    Jeff Strang Member
    Options

    Hi @Michael Udinski,

    Can the cry for help above! I solved it with a different javascript method for preparing the video file.

    Thanks : )

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hey @Jeff Strang - here's the video, which is up on our YouTube channel :)

  • Jeff Strang
    Jeff Strang Member
    Options

    Thanks Michael. I appreciate the response. We have built a custom web cam recorder using the MediaRecorder API, which uploads directly to Xano rather than to the user's device. It's working well in testing. We'll have to migrate it to AWS simply because Xano's storage is too expensive but I'm pleased to have it working.

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Awesome to hear!! Yup a separate cloud storage solution like AWS is much better to leverage for media-intensive applications. Glad you've got things running and mapped out!