Laravel 5.5 - read the images stored in external folder
up vote
0
down vote
favorite
In my Laravel 5.5 Project, I have saved the images in folder 'public/uploads' and I can read the images too with the URL http://localhost/my_project/public/uploads/77FAk4TSvXbX.jpg. Then I attempted to store the images in 'D:/Uploads' which was successful using the configuration
'local' => [
'driver' => 'local',
'root' => 'D:/Uploads'
],
But now I am stuck at retrieving these images. I cannot read the images directly as in case I could do previously, straight though URL.
Can anyone please help me for this?
Here is the code written to upload images to D:/Uploads
$image = str_random(12) . "." . $request->image->getClientOriginalExtension();
$request->image->storeAs('', $image);
php laravel-5.5 file-storage
add a comment |
up vote
0
down vote
favorite
In my Laravel 5.5 Project, I have saved the images in folder 'public/uploads' and I can read the images too with the URL http://localhost/my_project/public/uploads/77FAk4TSvXbX.jpg. Then I attempted to store the images in 'D:/Uploads' which was successful using the configuration
'local' => [
'driver' => 'local',
'root' => 'D:/Uploads'
],
But now I am stuck at retrieving these images. I cannot read the images directly as in case I could do previously, straight though URL.
Can anyone please help me for this?
Here is the code written to upload images to D:/Uploads
$image = str_random(12) . "." . $request->image->getClientOriginalExtension();
$request->image->storeAs('', $image);
php laravel-5.5 file-storage
Write down the error while trying get images...
– engrhussainahmad
Nov 11 at 11:34
I am stuck at how to retrieve the images. It would be easy if image could be retrieved straight through URL as described in question.
– user3810897
Nov 11 at 11:39
Write down the code you have written for uploading the image.
– engrhussainahmad
Nov 11 at 11:42
@engrhussainahmad - Upadated the question. I have just used Laravel's functionality.
– user3810897
Nov 11 at 11:54
are you trying file upload?
– Gowthaman
Nov 15 at 13:45
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
In my Laravel 5.5 Project, I have saved the images in folder 'public/uploads' and I can read the images too with the URL http://localhost/my_project/public/uploads/77FAk4TSvXbX.jpg. Then I attempted to store the images in 'D:/Uploads' which was successful using the configuration
'local' => [
'driver' => 'local',
'root' => 'D:/Uploads'
],
But now I am stuck at retrieving these images. I cannot read the images directly as in case I could do previously, straight though URL.
Can anyone please help me for this?
Here is the code written to upload images to D:/Uploads
$image = str_random(12) . "." . $request->image->getClientOriginalExtension();
$request->image->storeAs('', $image);
php laravel-5.5 file-storage
In my Laravel 5.5 Project, I have saved the images in folder 'public/uploads' and I can read the images too with the URL http://localhost/my_project/public/uploads/77FAk4TSvXbX.jpg. Then I attempted to store the images in 'D:/Uploads' which was successful using the configuration
'local' => [
'driver' => 'local',
'root' => 'D:/Uploads'
],
But now I am stuck at retrieving these images. I cannot read the images directly as in case I could do previously, straight though URL.
Can anyone please help me for this?
Here is the code written to upload images to D:/Uploads
$image = str_random(12) . "." . $request->image->getClientOriginalExtension();
$request->image->storeAs('', $image);
php laravel-5.5 file-storage
php laravel-5.5 file-storage
edited Nov 11 at 11:53
asked Nov 11 at 11:28
user3810897
34
34
Write down the error while trying get images...
– engrhussainahmad
Nov 11 at 11:34
I am stuck at how to retrieve the images. It would be easy if image could be retrieved straight through URL as described in question.
– user3810897
Nov 11 at 11:39
Write down the code you have written for uploading the image.
– engrhussainahmad
Nov 11 at 11:42
@engrhussainahmad - Upadated the question. I have just used Laravel's functionality.
– user3810897
Nov 11 at 11:54
are you trying file upload?
– Gowthaman
Nov 15 at 13:45
add a comment |
Write down the error while trying get images...
– engrhussainahmad
Nov 11 at 11:34
I am stuck at how to retrieve the images. It would be easy if image could be retrieved straight through URL as described in question.
– user3810897
Nov 11 at 11:39
Write down the code you have written for uploading the image.
– engrhussainahmad
Nov 11 at 11:42
@engrhussainahmad - Upadated the question. I have just used Laravel's functionality.
– user3810897
Nov 11 at 11:54
are you trying file upload?
– Gowthaman
Nov 15 at 13:45
Write down the error while trying get images...
– engrhussainahmad
Nov 11 at 11:34
Write down the error while trying get images...
– engrhussainahmad
Nov 11 at 11:34
I am stuck at how to retrieve the images. It would be easy if image could be retrieved straight through URL as described in question.
– user3810897
Nov 11 at 11:39
I am stuck at how to retrieve the images. It would be easy if image could be retrieved straight through URL as described in question.
– user3810897
Nov 11 at 11:39
Write down the code you have written for uploading the image.
– engrhussainahmad
Nov 11 at 11:42
Write down the code you have written for uploading the image.
– engrhussainahmad
Nov 11 at 11:42
@engrhussainahmad - Upadated the question. I have just used Laravel's functionality.
– user3810897
Nov 11 at 11:54
@engrhussainahmad - Upadated the question. I have just used Laravel's functionality.
– user3810897
Nov 11 at 11:54
are you trying file upload?
– Gowthaman
Nov 15 at 13:45
are you trying file upload?
– Gowthaman
Nov 15 at 13:45
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Write 'visibility' => 'public',
in the configuration file inside local
array and then try following code:
$contents = Storage::get('path_to_file');
It should work.
If you still have any issue let me know.
You're welcome. :)
– engrhussainahmad
Nov 30 at 22:37
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Write 'visibility' => 'public',
in the configuration file inside local
array and then try following code:
$contents = Storage::get('path_to_file');
It should work.
If you still have any issue let me know.
You're welcome. :)
– engrhussainahmad
Nov 30 at 22:37
add a comment |
up vote
0
down vote
accepted
Write 'visibility' => 'public',
in the configuration file inside local
array and then try following code:
$contents = Storage::get('path_to_file');
It should work.
If you still have any issue let me know.
You're welcome. :)
– engrhussainahmad
Nov 30 at 22:37
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Write 'visibility' => 'public',
in the configuration file inside local
array and then try following code:
$contents = Storage::get('path_to_file');
It should work.
If you still have any issue let me know.
Write 'visibility' => 'public',
in the configuration file inside local
array and then try following code:
$contents = Storage::get('path_to_file');
It should work.
If you still have any issue let me know.
answered Nov 11 at 11:57
engrhussainahmad
1257
1257
You're welcome. :)
– engrhussainahmad
Nov 30 at 22:37
add a comment |
You're welcome. :)
– engrhussainahmad
Nov 30 at 22:37
You're welcome. :)
– engrhussainahmad
Nov 30 at 22:37
You're welcome. :)
– engrhussainahmad
Nov 30 at 22:37
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248263%2flaravel-5-5-read-the-images-stored-in-external-folder%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Write down the error while trying get images...
– engrhussainahmad
Nov 11 at 11:34
I am stuck at how to retrieve the images. It would be easy if image could be retrieved straight through URL as described in question.
– user3810897
Nov 11 at 11:39
Write down the code you have written for uploading the image.
– engrhussainahmad
Nov 11 at 11:42
@engrhussainahmad - Upadated the question. I have just used Laravel's functionality.
– user3810897
Nov 11 at 11:54
are you trying file upload?
– Gowthaman
Nov 15 at 13:45