nickname | 16 May 20:05
Picon

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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Peter De Berdt | 16 May 21:40
Picon

Re: How to check file size before file upload completes?


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



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane