upload - Laravel uploading a file to the right directory -
I upload the file correctly only It is known that, in my case, the initial directory is public, and as a result Files are acceptable by everyone, when they should be in directories that are preserved by previous authentication, i.e. under the app.
So, when I do this:
$ file = input :: file ('fichero'); $ DestinationPath = 'Upload / Folder'; $ File & gt; This step ($ destinationPath); // model model $ model = make new model; $ Model- & gt; File name = $ file-> GetClientOriginalName (); $ Model- & gt; Destination path = $ destination_path; The file is saved in: Local ... / MyWeb / Public /
and that app is outside the original folder where all my application files are < / p>
I can think that the fact of going to that directory is because it is taking the defaults in the configuration file, which is localhost / laurel / public / index.fp/
/ p>
$ file-> Write something like move (base_path (.) '/ Uploadfolder / subdirectory /', $ newname; will be started with the defined base_path, but base_path should be like the local host / MyWeb / Public.
So, how do you write the path that goes to the directories under this app and is not public?
I hope I am not asking a dumb question, but I have been trying for several days and I have read 3 related questions here. >
Thank you
You can use:
This path will return you the local file system The uploaded images should be placed in the public /...////> folder.
Comments
Post a Comment