Welcome Guest, Not a member yet? Register   Sign In
How to access images under writable folder
#11

I like the random hash idea, seems easier to maintain.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply
#12

rather than one folder with gazillions of images (you'll always have way more than you expect) i have an images folder with 20 subfolders into which the images are allocated to maintain an approx even distribution
Reply
#13

(This post was last modified: 03-30-2022, 03:54 PM by John_Betong.)

Quote:@MGatner:
I’m a fan of symlinks (assuming you aren’t on Windows). Just create a symlink in public to the uploads folder. This also helps you keep your folder permissions consistent. Obligatory warning to use good security when making uploaded files accessible.

I’m using a Linux server, not familiar with using symlinks and would be grateful for a detailed example:

Code:
echo ‘<img src=‘“ .WRITABLE .’/folder/img.jpg” .’” alt=“#”>’;
Reply
#14

(This post was last modified: 03-30-2022, 11:13 PM by ignitedcms.)

(03-30-2022, 02:07 PM)badger Wrote: rather than one folder with gazillions of images (you'll always have way more than you expect) i have an images folder with 20 subfolders into which the images are allocated to maintain an approx even distribution

Yes I agree it is a good idea to have a two step access or more, such as folder (maybe user's id / timestamp) + random file name.

I think you have to be careful with just relying on random string names because of the 'Birthday Paradox' and chances of collision.

This is also why GUID's are probably the preferred method with maybe even appending or pre-appending a timestamp
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply




Theme © iAndrew 2016 - Forum software by © MyBB