Answer the question
In order to leave comments, you need to log in
Replace Request with another value?
Hello
The situation is this:
C form data arrives, validated and we get them in the controller.
There is an image file in $request->file and it contains a temporary path to the file.
It needs to be rewritten to another value.
I try $request->merge( array( 'file' => 'new value' ) ); and nothing works.
Answer the question
In order to leave comments, you need to log in
Even by rewriting the path value, you will not move the file, but only overwrite the path value and lose the path to this file. The file itself is located in a temporary folder, which means that after the reboot the file will not be there (or earlier - depending on the OS policy for cleaning up this directory). So, you will have to move the file yourself and immediately. Use the Storage facade for this .
The documentation describes how to configure and use it. You need a local driver , where you need to specify the path to the users
. If something needs to be stored in users
and something else, thenStorage
can work with several providers specified in the configuration at once. Well, write a relative name to the database, which is obtained as a result of moving the file to the appropriate folder.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question