-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
[SUGGESTION] Organize uploaded files in different folders #16
Comments
This would be an awesome feature, while currently everything gets dumped into the root , I think people like to organize things as pointed out above.. any thoughts to maybe adding this? |
my $.02 would be that this should be another, alternate file adapter. The simple s3 adapter does its job. A class based hierarchy could have its own adapter and a time based hierarchy (which we've used in other applications) could be another. |
Could be additional adapter options as well |
Any updates on this? Awesome suggestion btw! |
That would require a change in parse-server as well, which can be problematic as impacting all adapters. but why not. |
This would be lovely. But even if you didn't go as far and simply made sure any filename strings passed through are prepended rather then appended to the hash that's generated by the adaptor. An example: the file name saved to s3 is: S3 only allows you to search for file names via the prefix. Having the hash at the front essentially renders this feature unusable - unless you know the entire string. |
I certainly see why that would be advantageous. I think the problem here is that we shouldn't change the existing file name convention. So there could be an option to switch the order? @thedistricts are you interested in giving it a shot? I'd be glad to review. |
What we can perhaps explore is allow Then it’s up to the adapters to support such sub paths. That would be reasonable I believe. What do you think? |
@flovilmart, much better suggestion. |
Alright’ there’s a similar issue open on the server; I don’t have time now to implement it :/ |
@flovilmart, why do we need "UNIQUESTRING-" before filename? is there a way to remove that and keep the file name as is? |
Because of potential collisions on the clients and retry mechanisms. Also it helps prevent a potential attacker guessing the name of the ‘next’ file |
What if I'm controlling all of these from my side. Is there a way to make "adding unique prefix string" configurable? Or a way to override it? |
@sariabuzahra There's a similar issue for this particular case opened on the server that you can track here: parse-community/parse-server#4899 @markmssd this issue is 100% parse-server. As I mentioned previously, I don't have time to implement it at this time, however, I velieve it's reasonable to allow the |
Thanks @flovilmart , It's been a while I haven't touched Parse, it's just running smoothly in an old prototype I had back then, and I've moved to a Graph DB for the new app. I'm willing to give it a try but having some time constraints for now. I will let you know when I start :) |
The above PR pushes the directory decision to the parse client, and allows the S3 adapter to decide whether to allow directories or not. The current behavior is preserved if desired, or you can disable it via config on the FilesController and enable directories in the S3 adapter. IMHO: Unique filename guarantee belongs in the adapter. I suppose that desire could be expressed in the controller, then passed along to the currently loaded adapter for it to implement as it sees fit. |
Closing via #76 |
Hey all,
This is not an issue but a suggestion. If people seem to like it, I will implement it and PR.
I have the plugin installed and working perfectly. And the baseUrl set so my files get served through AWS CloudFront instead of through S3 directly (speed is crucial in my case).
However, all the files are getting uploaded to the same (root) directly. For example:
I think it would be much better if everything was saved in its own folder, based on which Parse Class saved it. For example, assuming a class
Car
and a classHouse
:It could be broken even further based on which column saved them. For example, assuming the class
Car
has a columnTopView
andSideView
:I personally think it will make files in the bucket much easier to navigate, especially when we have hundreds or thousands of them.
Let me know what you think!
The text was updated successfully, but these errors were encountered: