Is it necessary to store the photo in the database for this web app?

Hi,

I want to create a web app where the user uploads a photo and downloads it after applying the desired filter to the photo. Do I have to use the database? Is it necessary to store the photo in the database?

regards,

Saeed

You don’t need to store the uploaded picture anywhere; just send back the modified picture directly in the response to the picture upload request, or send back a webpage that displays the picture using <img> and the data URI scheme.

As @PeppeL-G said, you don’t need to actually store the photo. In fact, you don’t even need to upload it to a server at all if the client does all the processing - but that’s an architectural decision that depends on the app.

@lingo1357 storing the image in a db, apply filter, store the edited image again into the db to allow the user to download is too much code and wasteful. You need to do this only if the need is to keep a copy of before and after image for later reference/use. My suggestion is, store the image in local storage and perform all the actions required. This way the image is always available as long as the user is still in the session.

You need to test it out. We do this all the time in PHP apps and it works great, not done this in vue though.

Do you mean you give an effect to an image? you do this with PHP.
But how this is possible? isn’t it a front-end issue?

I did not mean that. I used javascript to do that within the php app. I was referring to the storage part where you do not need to store in a db instead use Local Storage in javascript/vuejs app. In PHP we use the Session storage to do the same.

I just wanted to use View for the visual effect part and ASP to save on the server.