Support the ongoing development of Laravel.io →
posted 9 years ago
Requests Forms
Last updated 2 years ago.
0

Not sure what you are getting here:

{!! Form::file('image') !!}

Of course convert to form helper
since that's what you are using, but I usually store images in an image folder, in list page I have :

$linev = "";
$linev = "<td><a href=\"{$picpath}{$row->dogpic}\" target=\"_blank\">";  
$linev = $linev . "<img width=\"80\" border=\"0\"";  
$linev = $linev . "src=\"{$picpath}{$row->dogpic}\"></a></td>";  
echo $linev;

Pic path is just:

$picpath = "upload/";

So in list view I am actually displaying the image.
However in the edit view I only show the image name:

<tr>
<td class="aright">dogpic:</td>
<td>
<input type="text" name="dogpic" id="dogpic" value="<?php echo $data->dogpic;?>">
</td>
</tr>

Again I don't know if you are storing images in a field or the images to a folder.
And by all means convert to form helper style, I have some code that I haven't converted yet, like the above.
But this does work.

Last updated 9 years ago.
0
Solution

After some searching i've discovered simply that's is not possibile in Php for security reasons.

This is allowed in a input text but not for the upload imagine. It needs a workaround, you have to create a preview of the image and with CSS hide the button's text "no image chosen" to let the user understand that the imagine is still in memory.

Thank you anyway

0

Sign in to participate in this thread!

Eventy

Your banner here too?

b82 b82 Joined 12 May 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.