slickness's avatar

Expand Filename

I would like to add a word to my filename, how can I do that?

$image = $request->file('image');
                $filename = time() . '.' . $image->getClientOriginalExtension();
                $location = ('storage/'. Auth::id() .'/posts/image/' . $filename);
                File::makeDirectory('storage/'. Auth::id() .'/posts/image/', 0775, true, true);
                Image::make($image)->save($location);

                $post->image = ('/'. Auth::id() .'/posts/image/' . $filename);

the filename after the upload consists only of numbers and I would like to add the word "thumbnail" to the filename at the end.

0 likes
1 reply
Snapey's avatar
Snapey
Best Answer
Level 122

seriously?

$filename = time() . 'thumbnail.' . $image->getClientOriginalExtension();

2 likes

Please or to participate in this conversation.