Be sure to validate the picture on the server. Vue, Laravel?

  • 0
    I have an example, I want to upload a picture to the server.
    1) I validate the selected image on vue.
    2) I encode it into a base64 string and send this code as text via ajax
    Is it possible to validate only on vue or is it necessary on the server.
    What are the ways to solve this?
    Laravel Anonymous, Mar 16, 2020

  • 2 Answers
  • 0
    Everything should always be validated on the server.

    Why don't you send the file itself to the server?

    Do you definitely need to first encode it in base64 and send it as a string?

  • 0
    In your case, you don't need to validate! In general, it is necessary.

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!