NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on March 05, 2014, 09:37:23 AM

Title: Dont allow to upload an image of more than xxMb
Post by: Alberto on March 05, 2014, 09:37:23 AM
Hi,
I need to message the user when it attempt to upload an image of more the xxMb.
I know I can add code to the WebHandler/HandleFile like

  if p_len>p_web.gsv('login_maxSize')
     return Level:Notify
  end

to avoid the image is uploaded.
but how to message the user about that?

Thanks
Title: Re: Dont allow to upload an image of more than xxMb
Post by: Bruce on March 05, 2014, 09:53:14 AM
unfortunately this is not trivial to do, because you don't know the size of the incoming file until the user posts it.
NetTalk 7 has a facility to;
a) prevent malicious clients from just uploading massive files and
b) the enhanced file-upload script let's you set a limit so that user knows when a file they've selected is too big.

cheers
Bruce