-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cloud file handling proposal #411
Conversation
See WICG#408. This does not completely fix that issue, since there is still once more reference that will be fixed with whatwg/fs#101
Prior discussions that are related:
|
Hi @alex292, I'm wondering if you'd be open to extend the proposal to include the non-goals as goals, specifically provide a standardized way for CSP’s web APIs to interact with remote files. There is another issue opened here #358 and in Chromium where we briefly talk about those goals. It seems like a great opportunity to finally integrate cloud storage into browsers to give standardized APIs to webapps to interact with remote files and remove dependency from the underlying operating system. Thanks in advance! |
That is currently not part of our considerations as that would not solve any of the listed use cases, so the answer is sadly "no". |
I guess the ideal user experience here might be that the OS/user-agent stores details of the user's cloud storage accounts, and then simply presents those folders as options in the That way it's completely up to the user and the user agent which filesystem is being interacted with (regardless of whether it's remote or local, or remote-but-locally-cached) - and the developer doesn't need to care about it at all. They just treat their file/directory handles like they normally would. There are likely a bunch of use cases that this approach would preclude, but the many-service-SDK wrapper might be able to cover those? At least for HTTPS-based services. |
Hmm, honestly this is not what i had in mind when i created #358 i only keep them in the cloud ☁️ So when i asked for #358, then this: const [fileHandle] = await window.showOpenFilePicker(pickerOpts);
const cloudIdentifiers = await fileHandle.getCloudIdentifiers(); ...was not what i had in mind. I kind of just wished that there where some magical way a website that you have visited before could just magically register itself as a cloud provider (Maybe with a manifest.json + service worker?) And the next time you called my idea was for developer to not being able to know weather or not it's a local file handle, or a remote-but-locally-cached or a fully-remote file handle the idea was to never have to install any desktop/phone application and just straight up being able to talk to services that you are logged in to in your browser. the idea was to make a killer replacement for https://www.filestack.com (previously called filepicker.io) and how photopea did it. but in a more native browser solution that talked just simply over http calls |
This proposal was not meant to solve #358, I have actually never seen that issue before. With this new web API, we are trying to solve the use cases discussed in the "use cases" section. I have been working with asully@chromium.org on this so far. |
I'm still confused as to why we even need this My intention with #358 was that you should never have to do any code specific things more dedicated towards google drive, dropbox, or OneDrive. The hole point of #358 was to avoid having to learn how to use a Google Drive specific API and doing things like if (cloudIdentifier.providerName === 'drive.google.com') {
// retrieve/modify the file from Google Drive API using cloudIdentifier.id
} then you must register a developer account at Google, get some kind of API key / token or something like that. The other point #358 was also so that you don't have to create a virtual network drive on your own computer and having to sync each and everything. it was so that you can still be able to pick remote files from google drive, dropbox etc without having to install any desktop application And the lightly hood that you get a cloud Identifier that your specific web app could understand and talk directly to is more unlikely. there exist hundred of different cloud provider. so every site would have to ad here to learn how to use each and every possible cloud api, where as #358 was trying to normalize the way of talking directly to a cloud provider without having to deal with lots of different code paths that could be taken. Now if the usecase is to be able to easily share something that's already uploaded to a cloud provider wouldn't it then be easier to just use the Web Share API or something like that instead? allow the Web Share API to accept a FileSystemHandle? maybe it will instead share a link rather than uploading file. learning how to use git, ftp, sftp WebDav, or smb is way easier to learn and that applies to multiple servers and it is way easier to learn then it's to having to dig deep into how any cloud specific docs/api such as how the OneDrive or Dropbox API works. it's google drive, dropbox and others who should have to learn how to hook in their own cloud system into the OS (a.k.a file system access) as a network drive, it should not be the other way around. and as such i think i'm -1 on this hole i think remote files should almost works lite as how some site can register itself as a payment provider using the web payment api |
Our primary motivation for this new web API is the remote file handling scenario. I.e. device A runs a web app that opens a file from a cloud storage (primarly GoogleDrive / OneDrive) and then passes that file handle to a remote server where the file is fetched directly from GoogleDrive/OneDrive, without having to transfer the file between these two endpoints. We have willingness from the Google side to implement this and we have willingness from partners to use this API. Additionally, this API also solves the de-duplication for online document editors (issue for Google/Microsoft) and allows for easier integrations as file attachments in web mail clients. I see your request for a unified way to access cloud storage providers and think it is very valid, but also orthogonal to this PR. |
I see your point that taking something from google photos and uploading it directly to eg facebook would be a valid point in that you would not have to download it from google and then re-upload it to facebook. But honestly i think that is something that could maybe technically be solved with WebShare API where sharing a remote A hole other solution could be to create something serializable like it would be like handing dropbox a ftp link saying "here a uniq FileSystemHandle identifier that happens to look something like the point i was trying to make with #358 was that you don't always have the luxury of calling |
This proposal adds a a new `getCloudIdentifiers()` method to `FileSystemHandle`, which allows to retrieve cloud handles for a file/directory. A cloud handle consists of a vendor identifiert (e.g. "drive.google.com") and a file identifier. With these, the web app can talk to the cloud storage provider through its APIs directly to retrieve/modify the file. This is useful for web apps to figure out if a file is already backed by cloud storage and allows for easier transfer across machines as just the identifier instead of the entire file contents need to be transfered. SHA: 4d4fbd8 Reason: push, by @a-sully Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This would be great to integrate into our product. In our virtual app delivery platform, we support filetype association. So for example when the user double-clicks a .psd file, we currently read it locally through the JS handle, send it over to a cloud-based execution host and open it there. Then, we sync all changes back and forth to the user's device. With this functionality, we'd gain a lot of speed and network usage, as the cloud execution host server would be able to open it directly from the Drive API (initial speed / network saving), and then the same time saving would apply for change syncing. This gain would be particularly interesting with >1MB files, which is often the case. As a good "side effect", this will also resolve for us sharing and exclusivity issues -- i.e. what happens today when the user works within a cloud session on a local file, and then that file is moved, deleted or changed locally. We already integrate with the Drive API, so having to go through JS file handles is a bit awkward currently. Definitely a big +1 ! |
This proposal adds a a new
getCloudHandles()
method toFileSystemHandle
, which allows to retrieve cloud handles for a file/directory. A cloud handle consists of a vendor identifiert (e.g. "drive.google.com") and a file identifier. With these, the web app can talk to the cloud storage provider through its APIs directly to retrieve/modify the file. This is useful for web apps to figure out if a file is already backed by cloud storage and allows for easier transfer across machines as just the identifier instead of the entire file contents need to be transfered.