I'm working on a web application that allows users to save files and folders. Right now, when users download folders, they come as zipped files. I'm curious if there's a way for macOS or Windows users to download the folders in their original structure, preserving all the subfolders and files without zipping them first. Is this possible?
4 Answers
Unfortunately, it's not possible to download entire folder hierarchies directly through a web browser without zipping. This is largely due to how HTTP downloads work; browsers can only handle individual files, and security settings prevent them from creating arbitrary folders on your system. Even the HTML5 File System Access API, which allows some file manipulations, requires user permission and isn't widely supported. So, for now, zipping is the only reliable method.
As it stands, you can't directly download folders using just a browser. If you're looking for an alternative, a desktop application could potentially handle that, but for web applications, you're usually looking at producing a zip file for downloads.
I've read about the File System API, and while it might allow some file management, I'm not entirely sure it can help with downloading folders in their original format. It still seems like a bit of a stretch in a web context.
Many applications, like Google Drive, follow a similar procedure—they let users 'export' folders, creating a zip file for download. This is a common approach since handling folder structures in web environments is tricky.
Related Questions
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads