On our end we’re using Weweb’s storage as a temporary environment. Using a workflow, a file gets uploaded to Weweb’s CDN, then we grab the public URL and pass it to an external service. This external services downloads the file and acts on it.
Once that is done, we no longer need to keep the file on the CDN.
Programmatically deleting the file allows for:
More space available as we can delete what we don’t need right away
It takes much less time to manage as we don’t have to manually delete files (clicking the “delete” buttons one by one)
It is also more secure as there are no public URLs to private files lying around
Perfect. Thanks for the detailed answer @gbeaudoin
I’ve added it to the ticket so the product team has a clear understanding of the need.
There may be a workaround in the meantime (to send the file directly to the external service without uploading to WeWeb’s CDN). Could you share what external services need to access the files uploaded by the user?
Us using Weweb’s CDN is actually a temporary solution to workaround an issue with Xano that refuses to save some files (PDFs and JPGs) because they are partially malformed (although they open fine on desktop).
When this happens, we need to store the file somewhere else, send it to a PDF conversion service, then add it back to Xano.
I know that we could use any other cloud storage solution, but we want to minimize the quantity of provider for any given project.
I’m using the method mentioned by @dorilama. It works pretty well. Here is my working JS code bound to the submit button. Since I only need single file if you need to upload multiple files you will have to modify the code.
And remember that you have to enter the bucket-name, otherwise it won’t work
var formData = new FormData();
var fileSource = wwLib.getFrontDocument().querySelector(“#myfile input”); //myfile is an id for upload element
var fileName = variables[/* myfile - value */ ‘76f7137e-d80e-483c-824b-a62a324f7554-value’][‘name’]; //this is variable which contains fileName from upload element
formData.append(“content”, fileSource.files[0]);
return await axios.post(“https://{your-supabase-account}.supabase.co/storage/v1/object/{bucket-name}/”+fileName, formData,{
headers:{
“Content-Type”: “multipart/form-data”,
“Authorization”: “Bearer {your auth token}”
}
})
No news on this. There are two open tickets on the product roadmap based on this thread but they are not prioritized yet.
The two tickets:
It would be nice to have a workflow action to delete files that were previously uploaded to WeWeb
It would be nice if we could select multiple files that were uploaded to WeWeb and delete them all at once instead of having to manually delete them one by one