Definition of an asset canister?

I was looking for the correct way to chunk large files in order to upload them from my frontend canister (React) to my backend canister (written in Motoko) and questions started popping up. I see many references to asset canisters on this forum, some mentioning asset certification but there is not much documentation to be found through the search bar on internetcomputer.org.

My assumption until now was that an asset canister is any canister that hosts static files (html, css, image files, javascript files). Basically anything that I throw into PROJECTNAME_assets/assets/.

Now, users of my app need to upload images. I remember thinking that I could just have React save them to PROJECTNAME_assets/assets/ but then I came to the conclusion that things don’t work like this because WebAssembly is probably doing stuff I don’t understand when I build and deploy my app so that these assets need to be there before my app is running, hence static assets.

I then concluded that I need to upload files to my backend canister written in Motoko if I want to have some kind of interaction with files (uploading, deleting, altering etc.) and that’s what I’m doing right now. However, reading up on chunking files, I keep seeing references to asset canisters and I wonder if I’m missing something crucial here. Is there a way to dynamically upload files to PROJECTNAME_assets/assets/ and if so, what’s the advantage over storing them as a Blob in my backend canister?

3 Likes

Sorry for the drive-by comment, but I spotted this and wanted to share it while I had a second in case it helps.

1 Like