How do you validate the data on the server side? #709
Replies: 1 comment
-
|
This is a question you should ask on stackoverflow.com |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For example, I'm sending the output of
signaturePad.toDataURL()to the server via POST, which decodes to a PNG image that is stored on the filesystem. How do we make sure no one can submit a different type of file?Right now my idea is to test if the decoded string is really a valid PNG image. PHP has the gd module for that. imagecreatefrompng is what I would try. There is also Fileinfo and the function finfo_buffer. Any thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions