NetTalk Central

Author Topic: Dont allow to upload an image of more than xxMb  (Read 2425 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Dont allow to upload an image of more than xxMb
« 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
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Dont allow to upload an image of more than xxMb
« Reply #1 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