passing data from another page

Options
I'm creating an app where I can have events in which I can post a photo. My issue is that I'm getting form is failing and I'm not sure why.

The post is simple:
1. image
2. description
3. challenge_id (which should be passed from the event page - I'm not sure how to handle this)

[image.png]On front-end side I choose as a remote action to get challenge and go to the add form which should take acquire challenge_id
[image.png]

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hi  - for doing content upload you will want to use the file resource input, additionally you'll need to take that input and use the function Create Image Metadata before adding it to your database. You can see an example in our documentation and also a tutorial in there - https://docs.xano.com/working-with-data/functions/content-upload#example-upload-an-image
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
      So in table my image should be image or file resource type?
    [image.png] 
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
    I changed my image type to file resource and now I can't change it back to image for some reason. Error -  Illegal offset type in isset or empty. [image.png]In some tutorials on youtube there is a method with image and image_url variable, is that obsolete?
    [image.png] 
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     in your table it should be image. there isn't a file resource schema type. File resource is the input type in your API endpoint that you want to use
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     - the file resource input can accept both an image file or an image URL
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
     There is such a type in table:[image.png]Moreover as I mentioned below I can't change it back now to image type due to  "Illegal offset type in isset or empty" error. I think it is some kind of a bug.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     hm I don't think that's supposed to be exposed. Go ahead and delete the column and create a new one that is an image type
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
    Ok request seems to work on Xano, but I have one last thing to ask.

    How to test it on Bravo and bind it with front-end? It seems that I need to add it somehow to body, to be able to test and bind it.
    [image.png]
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     Add it to your JSON body and pass a test value image URL just like you would with the other parameters
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
     I did and something is not right, it is working on Xano, but not in Bravo. As url input I've used url of image from get request which is already in my table
    [image.png][image.png][image.png][image.png]
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     can you check your request history to see what Bravo Studio is sending for that call?
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
    [image.png]I made some new calls a minute ago, but they did not appear in history yet. This is an older one.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     if the call is not in the history that means it was not made by Bravo - based on their error message maybe your request body had errors/wasn't formatted properly?
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
     I'm pretty sure that the test data input is the issue. Are you sure that url is enough for file resource input?

    shouldn't it be more complex like the result of request in xano?
    [image.png]
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Can you please share your parameter and JSON set up from Bravo studio?
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
    Sure.
    [image.png][image.png][image.png]
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     you input is named "content_image" but you are calling it "content" in bravo studio
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
     Aw sorry, I copied body from old request, it was a middle of the night in Poland. Here is a correct one which does not worked either. I changed the name of the input from "content" to "content_image" at some point , because my record in xano has the same name and I was thinking that maybe it is causing some trouble.

    [image.png]