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
The tech team is currently exploring a big ticket to improve file management in WeWeb, including deleting files that have been added to our CDN, but also making it easier to upload images directly to your own backend.
In terms of timeline to release the improvements, it’s too early to say because they’re still in the exploration phase. We’re hoping end of year but it could be delayed depending on technical obstacles and how other big tickets move forward like the marketplace and components.
I would like to display the user’s profile photo temporarily when they edit their profile and only send it to the backend if they click save changes. If he cancels the sending or closes the popup, I would like to delete it from the Weweb storage
We haven’t prioritized the “programmatically delete files uploaded to WeWeb’s CDN” feature yet.
However, you now have more options to work with files so you should be able to achieve the UX you describe without ever uploading the users’ files to WeWeb’s CDN