GoogleChromeLabs / carlo

Web rendering surface for Node applications
Apache License 2.0
9.31k stars 309 forks source link

Absolute file path #111

Closed f3l1x closed 5 years ago

f3l1x commented 5 years ago

Hi. Thanks for an carlo project, big 👍

I was wondering, is there any way how to get file upload path (absolute)?

pavelfeldman commented 5 years ago

Could you elaborate on that? What do you mean file upload path?

f3l1x commented 5 years ago

I mean how to get full file path from form upload without upload. There is some change in Electron/NW.js, so is possible to call file.path.

I would like to write a test app, that optimize images. So my intention was to pick files, retrieve them absolute paths and call some nodejs lib on them.

Is it somehow possible to do that?

pavelfeldman commented 5 years ago

Got it. I'll implement it, but it will only be available with the next Chrome update (Chrome 73), so it hits stable next year. Will be in Chrome Canary shortly though.

f3l1x commented 5 years ago

👍 You're the best.

f3l1x commented 5 years ago

Just for info, what does it chang in Chrome 73 to make it possible? Thanks for explanation.

pavelfeldman commented 5 years ago

I'll need to expose native information on File over the protocol. Something along these lines: https://chromium-review.googlesource.com/c/chromium/src/+/1377341

pavelfeldman commented 5 years ago

Fixed in https://github.com/GoogleChromeLabs/carlo/commit/64cdcfa5070dbbddb5124f51bb0464357051f837.

Note that the fix will hit Chrome Canary in a day or so, while Chrome stable will only get it in M73, Q1 2019.