Spaces-API icon indicating copy to clipboard operation
Spaces-API copied to clipboard

List directories only functionality

Open schmidtl4 opened this issue 4 years ago • 5 comments

What's the best way to get a listing only of folders. I know that folders aren't really folders but prefixes to the file name. That said, I'd like to be able to see just the folder names for a particular space. Any way to do that?

schmidtl4 avatar Jul 24 '21 12:07 schmidtl4

Hey, There are a couple ways that I can think of to sort of achieve folder-like functionality:

  • You could store folders in a separate database at the time of upload & refer to that database when you want folders.

  • You can iterate over all objects, explode() the ones containing a / using the char /, and then join n - 1 parts back to form a folder & sub-folder structure.

SociallyDev avatar Aug 04 '21 17:08 SociallyDev

OK thanks - not exactly what I'd hoped for but thanks for the suggestions. Les

Les Schmidt Simplicity, Clarity, Focus Founder & Executive Director BRIIA https://briia.io/ WE ACCELERATE INNOVATION

Why the Tri-Valley? See this http://www.bayareaeconomy.org/report/tri-valley-rising-2018/! LinkedIn BRIIA https://www.linkedin.com/company/briia.io/ | Twitter BRIIA https://twitter.com/briia_io | Medium @.***_IO> | LinkedIn Les https://www.linkedin.com/in/lesschmidt | +1 408.242.4986

On Wed, Aug 4, 2021 at 10:56 AM Devang Srivastava @.***> wrote:

Hey, There are a couple ways that I can think of to sort of achieve folder-like functionality:

You could store folders in a separate database at the time of upload & refer to that database when you want folders.

You can iterate over all objects, explode() the ones containing a / using the char /, and then join n - 1 parts back to form a folder & sub-folder structure.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SociallyDev/Spaces-API/issues/66#issuecomment-892856310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK2LSW6GMCNHIIEF2AUOADT3F5MFANCNFSM5A5OUTPQ .

schmidtl4 avatar Aug 06 '21 14:08 schmidtl4

This could be a nice enhancement actually.

I'm reopening this a feature request

MacroMan avatar Aug 06 '21 18:08 MacroMan

Please tell how to create a new folder in space, please tell api with example. Thanks

divyeshJoshiG avatar Sep 02 '21 06:09 divyeshJoshiG

Please tell how to create a new folder in space, please tell api with example. Thanks

You can't do that directly. Spaces doesn't support having an empty folder/directory. You can upload text/file with the path, which will "create" the directory on demand: $space->uploadText('Lorem ipsum', 'folder-name/remote-filename.txt'); If all files are removed, the folder/directory will be removed too.

MacroMan avatar Sep 23 '21 16:09 MacroMan

This library is now deprecated and this feature will not be implemented. We recommend using the official SDK or the Laravel package

MacroMan avatar Dec 15 '23 11:12 MacroMan