Laravel API temp image via url - laravel

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

Related

Storing images in storage folder of laravel, and fetching it by a http request is not working

I have deployed laravel application in heroku. I am storing images in storage folder of laravel and trying to fetch it by defining a route. It was working well on local, but when i trying to do the same on server, then its not showing the images. I thought that storage folder is inside the laravel, so it should work fine, but its not working.
Can i store images in public folder by creating a named folder "gallery" inside that and put that gallery folder in gitignore. so will the gitignore folder be vanished when i will push the laravel project again?
Other options are using another file system. Most of them are paid, so i was thinking to save the images in database, is that the good idea or i should move to files only.
First of all, the storage directory should have right permission.
You should create a symbolic link from public/storage to storage/app/public.
Create the symbolic link:
php artisan storage:link
You cannot save images in database, only their names or links etc. I implemented the same thing you did by naming the files to their path and storing that to the database and then using it to fetch the data from folder on sever

How to change path of ckeditor image upload

I have laravel application and using ckeditor and laravel file manager to upload images and files. This store images in public/photos folder. I want to change folder where images are stored. I have set ftp disk in laravel filesystem (https://laravel.com/docs/5.4/filesystem).
So I want to store all images uploaded from ckeditor to new server which is define by ftp disk in config/filesystem.php.
Please help me out!
In app/config/lfm.php find:
'base_directory' => 'public'
Replace public with your storage path, for example
'base_directory' => 'storage/app/media'
This works for local, I think it would work for remote work too.

Carrierwave AWS No Change When Re-uploading Image with Same FIle Name

I am currently using carrierwave-aws to upload to my S3 bucket.
One issue I am having is after the image is uploaded and saved, if the user, lets say changed something about the image locally and re-submitted for upload with the same file name, it will not reflect the new file uploaded.
The user has to change some part of the file name for it to show the correct one in my application.
I am assuming this is a caching issue but not sure where to begin to address this matter.
Has anyone else experienced this?
If your S3 bucket is set with a long or infinite expiry (which is a good idea for performance), you'll need to change the filename each time the image changes. See the Carrierwave wiki page on how to do this.

Migrating Wordpress Uploads To Amazon S3

I currently use a plugin on wordpress that creates a carbon copy of the uploads in a s3 bucket whenever a new picture is added. The problem is on the same site there are about 700 pictures uploaded before we started to use this plugin that aren't on s3 and we need to free up some space. The plugin doesn't copy these old pictures over.
Does any one know of a way to redirect all the image urls to the s3 bucket instead if we manually copy the files over? Could this be done with a htaccess in the uploads folder?
Thanks for your help I am very bad with redirects and things and need to improve.
Jozef
Using:
RedirectPermanent /wp-content/uploads http://xxxx.s3.amazonaws.com/wp-content/uploads
In your main .htaccess file should do the trick, note this will redirect all uploads (including potentially non-image uploads).
No need to install any plugin. I did it by mapping wp-content/uploads to S3 bucket using S3FS. Refer Moving wordpress uploads to Amazon s3 using S3FS
If you want to save space on your server, don't use use_cache option while mounting S3FS. Good luck!
try to use s3cmd
install it configure it by providing it access and secrate key of aws
then sync your upload folder or image folder with s3 bucket
and your done

phpbb and filesystem storage

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.

Resources