How to check file size before file upload completes?

Is it possible to check a file’s size before a file upload completes?
We want to limit file uploads early by checking the header’s content
length from the request object. The controller action and
before_filter doesn’t seem to run until the file finishes uploading.

On 16 May 2008, at 20:09, nickname wrote:

Is it possible to check a file’s size before a file upload completes?
We want to limit file uploads early by checking the header’s content
length from the request object. The controller action and
before_filter doesn’t seem to run until the file finishes uploading.

Use a Flash uploader, it will even do clientside filesize validation.
SWFupload.org is one of them. They do have some gotchas with Rails
cookie store and sessions, but you can find more information on that
by searching the list archives.

Best regards

Peter De Berdt

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs