Page 1 of 1

Assign image in files collection to a specific row in the database

Posted: Sun Feb 08, 2015 6:24 am
by Rui Song Chong

Hi,

I'm able to use my app to upload image, and create rows in database, however the image uploaded is not link to the row I created.
Image

RIght now, I have a create_service and a upload service which would be invoked when I click the upload button. But in the database, the image I uploaded is not linked to the row I created. How can I link it without having to go to the database manually? Thanks!
Image


Assign image in files collection to a specific row in the database

Posted: Sun Feb 08, 2015 7:05 pm
by Illya Stepanov

Hi -

To understand how to work with images in Appery.io I'm recommending to start here: http://devcenter.appery.io/documentat...


Assign image in files collection to a specific row in the database

Posted: Mon Feb 09, 2015 7:23 pm
by Rui Song Chong

Hi,

As you can see from the image, when the user tap on the upload button, the rows should be created automatically with the file uploaded, what you suggested is how to manually link the images right? which is not what I want.


Assign image in files collection to a specific row in the database

Posted: Tue Feb 10, 2015 4:39 am
by Yurii Orishchuk

Hi Rui,

At first on "success" event handler of "upload" service - you should save "fileName" into some storage.

Then, on "success" Event of "upload" service - you can invoke "create" service.

Also - in create service you should link "fileName" from stored in storage value to "fileName" of your file type field.

Details: http://prntscr.com/639sca/direct

Regards.