Hello, I am able to successfully upload an image to the database using the tutorials given. The issue is when I want to link that image to the user profile. The structure I have starts with the users collection that has a pointer to a Customers collection. The customers collection has a column of type file which I am expecting to store the main profile pic to. I can manually update that column to point to the file I just uploaded to the files collection, but I don't know how to do this programmatically. I have gone through all the tutorials and can't find out how to do this. On success of the file upload, the response returns a filename and originalfilename, but when trying to map that to a variable, it fails and doesn't continue to process further commands. Any help is much appreciated.
Please check this post, hope it will be useful for you:
Thanks, this actually did help and I was able to store a string representation of the image base 64 in the collection. Do you have any information on how to actually store something with a column of type file???
Please read this brief explanation https://devcenter.appery.io/documenta...
Alena, thanks I appreciate it, I have seen this link numerous times. I know how to store the file using the media manager through the interface you have available. I am more interested in learning how I do it programattically. Do you have an example where the user loads a specific file to the media manager, and then that file is referenced back to the file column of a different collection?
Here is a common plan to upload file and store it in "file" type collection field.
1 Upload file and fetch "fileName" value from it response. Store it in some storage.
2 In update/create service you need to link value from storage(1st step) to file-field "fileName" request parameter.
So basically you need to pass received from upload service fileName to fileName request parameter in update service.
Thanks Yurii, we're getting closer. The problem is when I upload an image to the file collection following this tutorial... https://devcenter.appery.io/tutorials... . It does not return a filename to me anywhere. Do you have steps to show me how I use the service with the mapping so it returns the filename? Thanks.
Yes if you use this "upload" service - your service responds with these parameters.
Please check upload service if you don't have such parameters you need add them manually.
Yurii, thank you so much for this reply. I see where the problem was. It was in the creation of the upload service that is created automatically. The response body was not in the same format as in your screenshot. Once I changed it, I started seeing the results. It looks like you may have a bug in the service creation and how the response is generated. Thanks again.