Thanks, I've seen those threads, however they all seem to indicate that it should be supported in public apps now.
I've worked around it by creating a resource query to upload to retool storage when a file gets selected by the File Input. However, if that works, I'm not sure why using the Upload interaction in the File Input doesn't.
Thanks for reaching out and bringing this up. There is definitely some inconsistent behavior here that we probably need to address. As you noted, a POST request directly to the /api/files/upload endpoint fails due to lack of access token but we're able to trigger a query without any issues.
The workaround you've implemented seems like the way to go, for the time being, if you want to allow public uploads. I'll talk to our team about clarifying which of these behaviors is intended and provide any updates here when I can!
Actually, I already have an update here. I was putting together a reproduction of the issue for our dev team and noticed another inconsistency, which seems to speak to the core of the issue.
The file upload works flawlessly when generating a default public link but fails when using a custom URL.
Hey @Darren, I am experiencing this issue and desactivating customURL did not help. Would you have any idea how to make upload to storage work on public app?
Hey @Tonep! I just did some quick testing and deactivating the custom URL still allows me to upload successfully, so I'm not sure what might be happening on your end.
Regardless, the better solution is to take a slightly more manual approach and write a separate query for handling the upload:
just came across this issue again after forgetting for a while that it exists.
I have two dropzones in a form where it works on a normal, internal app.
Once i deploy the app as public, i still get the same error.
I can write a separate query for handling the upload, but which event shall i use on the dropzone component? If i use "change", than also removal of a defined file will trigger the event.
I think the onChange event is the correct one! To prevent the query from running when removing a file, you can explicitly disable it in the advanced settings.
Hi all! Thanks again for flagging this particular issue. We've debated different workarounds internally and ultimately decided to start phasing out the checkbox-based option.
The recommended approach is to instead configure a dedicated upload query, as outlined above. Don't hesitate to follow up here if you have any questions about implementing that!
Hey @Tom_Suter - I think the query you've written should execute without any issues, but the error message you're seeing is probably the result of still having the Upload to Retool Storage option checked.
Try unselecting that particular option and let me know if you still have issues!
Hi @Darren, ah yes, you're right. Now I get it. Sorry, I'm pretty new with Retool. Enjoying it a lot though. Cool that there's a community that helps so fast.