PDA

View Full Version : FileUploadField reset



raj_plays
14 Feb 2011, 12:14 PM
Hi,
I have a form that contains a Ext.ux.form.FileUploadField control that is given here..
http://dev.sencha.com/deploy/dev/examples/form/file-upload.html

I want this field to be non mandatory(allowBlank: true) but I find that even if I do not select a file,
it still submits a file without a name for upload.
How can I prevent this?

raj_plays
15 Feb 2011, 10:07 PM
Hi,
It turns out that when a file is not uploaded, the form still posts a file in the request object but its content length is 0.
So, on the server side, I check the content length and proceed with upload only if it is non zero.