A
A
asdasdqwe2021-12-24 12:08:07
Laravel
asdasdqwe, 2021-12-24 12:08:07

What is the difference between putFile and regular store??

$path = $request->file('avatar')->store('avatars');
 $path = Storage::putFile('avatars', $request->file('avatar'));


The documentation says that putFile is a file streaming to storage and can significantly reduce memory usage.
But what does this mean, in any case, we save the file in storage. Or does putFile compress the file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Georgy Eremeev, 2021-12-24
@asdasdqwe

store is a wrapper around putFileAs for convenience - see here
putFile also uses putFileAs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question