Hi,
I have this scenario which I am working on.
User wants to select an image from the local desktop computer or phone to be attached to a record (profile pic, team logo etc). Basic sample screen is below.
Currently I am using:
- Image Component - display the image
- Icon component - clicking “X” allows the user to revert to a “default image”
- File Uploader Button component - “Select file”, displays the client file open dialog box
- Text box - “Some text to store in the database alongside the image”
- Save Button - after the user is happy with the local image selected save the image URL and text to the database
- Delete Button - not relevant for this topic but removes the record from the database
The FileUploader Button and the Image component all work on URL’s which I have pointed to Backendless file storage. But it means all file open/view requests need the image/file to be stored in file storage to then view them in the app. This means (I think) that to display a users selected files/images in a UI Builder app you have to:
- Upload the files to a temporary location in Backendless storage until the user selects the right image.
- Remove the temporary file(s) if the user decides to not save the current image in the Database record.
- When the user eventually clicks “Save” then link the uploaded file URL to the saved record in the database.
It works. But I don’t think its efficient and the round trip to upload the file and then display it in the image viewer takes 2-3 seconds which is a bit slow.
If there is a more efficient way to already do what I have described above without JS components I would really like to know.
Few suggestions?
- Can we just have a UI Component that displays the “client file open dialog box” and returns the file/files selected? Or modify the FileUploader Button with an option to just return the selected file(s) and not continue to the upload. In this case it might be better to call the “FileUploader Button” “OpenFiles Button”.
- Can the image viewer component be modified to also display in memory file/image objects not just URLs?
- Maybe the best flexibility is to have all the “File Uploader Button” functionality split into a number of Codeless blocks which will enable the developer to put together a sequence of no code blocks and UI components that support the file operations (select/view/upload) that best meet the application use case.
Again thank you for a great product and your excellent support.
Glenn