I am just trying to implement Secured Upload functionality. Instead of asking user to select a file to upload, I have a textarea where user can paste the contents. I will parse it in JS.
I want to limit based on size not based on number of character. If it is number of charatcters, then I can easily implement it in JS
Doubts
1) Is it safe to limit data based on size?
2) I am new to JS. In C, One char is one byte. So I can calculate size easily. In JS, How can I do that?
3) If JS is also same as C style sizing, then does it browser dependent?
Any suggestions?
I am not interested in max length
property of text area
.
SIZE
I mean size by kilo bytes, mega bytes,..