phpbb and filesystem storage - image

Can I save the images file on filesystem (no db) in phpbb?
thanks

Actually Avatars are stored in "/images/avatars/upload" directory. Standard images attached to messages are stored in "/files" directory in a hashed format. Any thumbnails you generate are stored as "thumbs_[hashed-code]" in that same "/files" directory.
Pete

Images (uploaded avatars and attachements) are stored on the filesystem by phpBB, more specifically within the store directory.

Related

Laravel storage, should I organize my files on database?

I have a web app where the user can upload files, create folders and stuff like that, I upload it on Google Cloud Storage, and organize it on a table files on my database, where I save the file name, path, size, extension, name, etc
But now I have a problem, if I rename a folder, I have to update multiples files on my database, update the folder and all the children, on storage I have to move each file to a new directory and delete all the content of the old directory
It seens to be too much just for a rename, I think the correct way to deal with the file manager should be just retriving the files directly from the storage and get over my database table
That is my question, should I get over my files table?

Laravel API temp image via url

I'm working on a Laravel API project, let see when you upload a image I change the colors, with a shell script. The api accepts urls so that means I have to save the image in a temp folder so that I can edit it and save it to my S3 filesystem. Is it convenient that I save the temp image in the S3 filesystems or local?
It will likely be much faster to save the image locally in a temp directory to make the changes before storing it on S3. You can use sys_get_temp_dir() to get a path used for temporary files.
https://secure.php.net/manual/en/function.sys-get-temp-dir.php

Where should we store data (files) from users in Laravel architecture?

I have a project that is meant to work for some countries. For now, in this example lets says USA-(us) and France-(fr).
So, when the user write in the URL us_mySite.com, the system should open the files, or display some pictures related to us only, not fr
At some point the user will need to update some file (pdf, excel, pictures, videos, etc) and the system must store these files inside the correct country.
So now we have in the site root a structure like this:
www/myStie/
...
...
data/
us/
excel/
pdf/
fr/ ...
img/
us/
fr/
...
...
Now I am migrating the system to Laravel 5 and I would like to know where should I put this data folder. Should it be inside Public/ folder? This folder should be accessible for delete, read, changes and save files trough the process.
This is quote from laravel doc: https://laravel.com/docs/master/structure#the-public-directory
The storage/app/public directory may be used to store user-generated
files, such as profile avatars, that should be publicly accessible.
You should create a symbolic link at public/storage which points to
this directory. You may create the link using the php artisan
storage:link command.
Store them in public folder.
https://laravel.com/docs/master/structure#the-public-directory.
That's where all the assets go. Check the above link for more info.

Does Laravel have a convention for a local permanent uploaded file storage location?

I have some forms that allow the user to upload files that only they can view so I will have to store them somewhere. However, I haven't been able to find any information about where these files would usually be stored if I want them to be kept on the local server. Therefore I have to assume that there is no convention for the permanent storage location of uploaded files. Am I correct in this assumption?
To be clear, I'm not talking about temporary storage locations.
Additionally, would it be a bad idea to have the storage location of all the files as a subfolder of the app directory (with gitignore enabled on it)? Or would it be a better idea to have it outside of the app folder? Thanks!
There is no explicit convention on where to store user uploaded files.
However Laravel ships with a storage directory where it stores framework related data such as cache, sessions, etc. As the name denotes it's a good place to store files, not just framework files. Also the Laravel Filesystem Documentation mentions that the default configured location is storage/app (but that can be changed to fit your needs):
When using the local driver, note that all file operations are relative to the root directory defined in your configuration file. By default, this value is set to the storage/app directory. Therefore, the following method would store a file in storage/app/file.txt: Storage::disk('local')->put('file.txt', 'Contents');
This storage/app folder will by default be ignored by Git.
If you also need the files to be publicly available, then you have two options:
1. Store them somewhere in the public directory.
2. Store them in the storage directory as suggested above and create a symbolic link to the folder from a public location. On Linux you can run this:
ln -s /path/to/laravel/public/files /path/to/laravel/storage/app/files
Of course the directory names can be whatever you like, I used files as an example.
The first option is for cases where you don't have shell access or are otherwise unable to create symbolic links. So if possible I suggest you use the second option.
Laravel uploads to the temporary file path, then you will have to move the file:
$request->file('photo')->move($destinationPath);
This method will move the file from its temporary upload location (as determined by your PHP configuration) to a more permanent destination of your choosing.
SOURCE: https://laravel.com/docs/master/requests#files

How to backup Core Data sqlite file with image for my iphone app?

I use Core Data to store the URL path of the image file in my document, how to backup both of them to mac/PC, I copy the sqlite file and the image out through iTune, and when I copy them back to iPhone, the sqlite seem to be ok, but the image didn't show up. I think the path has changed.
what can I do?
I have done something similar. Two things were key to making this architecture work.
The image files must be stored in a consistent location relative to the Core Data store file.
The URL/path stored in Core Data for the image is a relative one, not absolute. The image path is made relative to the Core Data store file.
Relative Location on Filesystem
I stored all images in a subdirectory named "Images" that lived in the same directory as the Core Data store file. E.g.
parent directory/
--> MyCoreDataStore.sql
--> Images/
-----> SomeImage1.png
-----> SomeImage2.png
Essentially, I treat the application's data as a file package: a directory containing multiple related files that all together comprise the application data or data document.
Relative image URLs
URLs (or paths) to images must be constructed at runtime. The Core Data store holds a relative path/URL to each image's location. The location is relative to the location of the Core Data store file. Your app always knows the full path/URL to the Core Data store.
I build the full path to an image location when needed using the parent directory of the Core Data store file and the relative image path held in the Core Data db.

Resources