`get_upload_url` does not work as expected
class ImageOperationState(r.State):
source_image:str = '/sample.jpg'
class SomeState(r.State):
imgopst = await self.get_state(ImageOperationState)
imgopst.source_image = r.get_upload_url(outfile) # this would not work
printing the source_image gives:
<reflex.Var>{"state": "", "interpolations": [[0, 28]], "imports": {"/utils/state": [{"tag": "getBackendURL", "is_default": false, "alias": null, "install": true, "render": true, "transpile": false}], "/env.json": [{"tag": "env", "is_default": true, "alias": null, "install": true, "render": true, "transpile": false}]}, "hooks": {}, "string_length": 114}</reflex.Var>{
${getBackendURL(env.UPLOAD)}/uploaded_files/test2.png-1a6d83df-f67a-4ff6-bc13-ae2214abab93-1719775789482107314}
Instead of the image path
is it feasible to move the rx.get_upload_url bit to the frontend code and only store outfile in the ImageOperationState?
get_upload_url is intended for frontend rendering, but it does sort of work on the backend for the limited case of being passed to rx.download
works as expected, rx.get_upload_url isn't supposed to be used in frontend not backend, as such, it returns a var