Uploading files to app before user downloads from the app store

My app is a “Virtual Try-On” of sorts, the user can upload an image, and i have a custom HTML component (using Webview) that pulls an image - that was taken with the “Take photo” component - with javascript and applies the filter using DeepAR. Great stuff if you have a chance to look at.

I’m in the situation where I need the 3D html files to be called dynamically within the html Webview component - there are about 70-ish files that make up around 100mb’s. Using a REST API to call these files the way that i need them is way to complex of a method for what im trying to do. That’s a last resort for me.

My first question, is there a way to uploading files to “root” BEFORE i send the app to stores so that the files will be readily available to everyone without an additional download after the fact? (if this isnt a thing, it definitely needs to be, the ability to upload files to the root source of the app)

Second question/issue i guess, I’ve tried to use the Download files flow component to download all of the files, but I can not find the actual path/directory those files are being put in. The only way I can find the download path is by using a formula to display it in the app, but it gives me a randomized blob each time I download, it doesn’t apply the custom name I set for each file so thats out of the question for now.

Here’s an example from my test page:

I’ve tried using the Cache files, but thats sort of the same thing, it doesn’t apply the actual file name, just a randomized name in the Cache path. I guess I could pull a “File exists? --no–> cache file → move/rename” but that’s seems a little extra, and it might bog down the users phone.

Any input is welcome.

@Mevi tagging you because i think you’d be able to help and would know what i should do haha

Hmm this isn’t really my expertise, but I’ll give it a shot :sweat_smile:

  1. Not really that I know of. The Build Service will attempt to download any URL in use on the app (this works for images well) so you could try that, but I’m not sure how you’d access them if they’re not on a page where you show/hide them or something :thinking:
  2. I’m not sure why it’s super important to have the original custom name for the file, but if you do need it (instead of just storing the file path in your page/app/data variable with the information of which file it is) but if you do need this, the cache file + rename is probably the way to go. The key will be to remove files when they are not needed / take care to not lose track of them, so you don’t save them too many times.

In my case, I was using a Webview component to dynamically call specific files from the root of the app, and passing 166 variables through a page and linking those to the HTML seemed like a major time suck, but I ended up having it work with using the Cache and Move/Rename workflow to place them permanently in the app filesystem whenever the app is opened for the first time.

I know this is a pretty unique case but I think that could be a nice small feature to have, uploading files to root.

1 Like