Folder structure in ES3Cloud

Vote for new features, or make your own requests here.
Post Reply

Folder structure in ES3Cloud

Yes, I would like this feature
2
100%
No, I would not like this feature
0
No votes
 
Total votes: 2

User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Folder structure in ES3Cloud

Post by Joel »

Status

Complexity

5/10

Description

This request is for a folder structure in ES3Cloud. This would allow people to upload using a path, which would then allow them to download all files in a given folder.

One way to achieve this would be to split the filename from the path, and then store the path (minus the filename) in a path column in the database.

As this would require changes to the MySQL database, care should be taken to ensure that it is backward compatible with previous versions.
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
krolldk
Posts: 25
Joined: Sun Jun 02, 2019 11:15 am

Re: Folder structure in ES3Cloud

Post by krolldk »

I thought a little bit more about it, and maybe the feature is a bit harder than I originally thought....
e.g. nested folders would be tricky...

ES3File myFile = new ES3File("dir1/dir2/dir3/filename.es3") would, with my suggestion, be saved in the DB as :
dir1/dir2/dir3/ in the path field, and "filename.es3" in the filename field.
You could still have a GetFiles("dir1/dir2/dir3/") command, and return filename.es3, but what if I ask:
GetFiles("dir1/dir2") ? I would, as a dev, expect to get something like "dir3/" returned, because that directory conceptually exists in my filestructure, but that would be hard to implement in a sane and efficient manner.

So: Maybe you want to keep the current DB structure, and instead support regexp in a new function: e.g. GetFilesRegExp(string regexp). If I do e.g. GetFilesRegExp("dir1/*") I get all files with filename starting with "dir1/" returned.

This will NOT require a database change, and probably be easier and more efficient to implement in the php script ?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Folder structure in ES3Cloud

Post by Joel »

Thanks for the suggestion, much appreciated. The ideal solution would likely be a mix of both of these.

The public API would be accessed through a method call such as (this code is simplified):
var ES3Cloud = new ES3Cloud("https://www.site.com/ES3Cloud.php");
yield return StartCoroutine(cloud.DownloadFiles("/dir/myDir/", "user", "pass"));
// Plus an equivalent method to download ES3Files.
And underneath, it uses MySQLs Regex to get these files. This would keep the API accessible, while also giving us the flexibility of Regex, and backwards compatibility with the current MySQL table :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
krolldk
Posts: 25
Joined: Sun Jun 02, 2019 11:15 am

Re: Folder structure in ES3Cloud

Post by krolldk »

Yeah. That makes sense. Not everyone can use regexp I suppose. Would it be too much to ask for ALSO the regexp thing for those of us that do speak regexp ? I mean, that would make it pretty powerful for us, allowing us to do stuff like:
yield return StartCoroutine(cloud.DownloadFilesRegexp("/dir/myDir/*.foo", "user", "pass")); to download all files in directory dir/ with fileextension .foo. And very little extra work for you....
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Folder structure in ES3Cloud

Post by Joel »

Would be a no-brainer from my perspective, so that would definitely be included at the same time.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply