php - Filename maxlength -


i have form file upload this

<form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">filename:</label> <input type="file" name="file" id="file"><br> <input type="submit" name="submit" value="submit"> </form> 

sometimes user upload files 200 characters name. exist way limit filename maxlenghth?

use code graham , check filename length php

if(strlen($_post['name']) > 200) { echo "filename long"; exit; } 

and must added max_file_size html-form otherwise php don't uploaded file

<input type="hidden" name="max_file_size" value="maximumfilesizeinbytes"> 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -