Rodrigo

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Rodrigo

Guest-62

Hello there,

Congratulations, this control resolved all of my problems but one a cannot solve.

How can i check the file size before upload a file?

The users have a limited space to put their files.

Reply | Threaded
Open this post in threaded view
|

Re: Rodrigo

Dean Brettle
Administrator
Hi,

There is no way to check the file size before the upload starts, but the development snapshot (currently NeatUpload-trunk.160.zip) will reject uploads which are too large almost immediately, so that the user won't have to wait for the upload to complete to find out that it was too large.  For details on how to configure the maximum upload size, see the 'Limiting the Size of Upload Requests" section of the doc\Manual.html included in the above zip file.

Hope that helps,

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: Rodrigo

Ronald Donis
First of all great control!, now i'm having this issue is there some event that may be a
callback just to validate some properties on the file posted? this is for
giving the ability to cancel the upload asap instead of uploading it and later
show the user that he waited for some error to happen...

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: Rodrigo

Dean Brettle
Administrator
Due to browser security, the only information available on the client-side prior to file upload is the name of the file.  You can use a validation control like ASP.NET's RegularExpressionValidator to verify that the name is valid.  The size of the entire upload (which includes all files, other form fields, etc), is available to the server immediately after the upload begins.  As mentioned above, NeatUpload can be configured to reject uploads almost immediately if that size is too large.

If you need to reject files based on their contents and you want to do it before the upload has completed, you'll need to look into Creating a Custom UploadStorageProvider.

--Dean