Closed lexoyo closed 10 years ago
Alex, the pick() API doesn't seem to allow folder selecting, does it ? How did you do when you were using file picker with Silex ?
Oups sorry for the delay I used to ask the user to select a file in the directory he would have selected I will use the new { folders: true } option to test it in Silex
I tried but it does not work :(
It is live here http://preprod.silex.me/silex/
All it does is open the file picker normally. To reproduce: "file" then "settings" then the browse button "...". There CE is opened with pick({ folders: true }, successCb, errCb)
Yes, it's normal, I've removed it in the haxe version since it's not in the Ink File Picker API / specs :(...
I see you really need it so I'll add it again but I do not like to diverge from our initial API / specs... However, I do not see any other solution here...
By the way, in which scenarii do you need to select/pick a folder ?
OK, I've just added it on the repo... By the way, I also implemented mime types / extensions filtering:
You can now do this:
pick({ mimetype: "image/jpeg" }, successCb, errCb);
// or
pick({ mimetypes: ["image/jpeg", "image/png"] }, successCb, errCb);
// or
pick({ extension: "jpg" }, successCb, errCb);
// or
pick({ extensions: ["jpg", "png"] }, successCb, errCb);
For folder picking, do this:
pick({ mimetype: "text/directory" }, successCb, errCb);
And forget about pick({ folders: true }, successCb, errCb)
.
Cool, thx!!
By the way, in which scenarii do you need to select/pick a folder ?
When the user opens the publish settings, he is able to choose the folder to which Silex publishes the website
OK, ... please confirm the issue is fixed once you've tested it...
Also, note that this feature (pick filtering) will see some improvements later for example: Ink allows to do this: pick({ mimetype: "image/*" }, successCb, errCb);
. That's not yet possible in CE but it will be ^^...
Closing this for now as we can select directories now. Please reopen if needed.
Alex, can you describe this use case please ?