Answer the question
In order to leave comments, you need to log in
Image from database to view?
There is a form for editing data, for example, the
name of the picture
and the image itself (stored in the database as varbinary)
how to correctly display it in the view so that when changing only the name and saving, the picture does not disappear?
update method:
view:
Answer the question
In order to leave comments, you need to log in
When submitting the form, if the user did not submit another picture, you will have to get the previous picture from the database again and use it when saving.
In principle, if you have flags of a small size, they can be integrated into the view as base64 in a hidden ( hidden ) field :-) Then you don't have to make a request to the database. But in real conditions, this is of little use, since there is a risk of falsifying form data or losing the relevance of the data, which must be checked by getting editable data from the database before making changes to it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question