File Control clears on postback.
i have a problem with my <input type='file'> control.
i'm trying to upload a file using this control. at the same time i'm checking whether the file already exists. if yes, it should replace the file, if no then should upload the as a new file. but the problem is that there are two buttons apart from the upload button: the 'yes' and 'no' buttons. when i click on either of the buttons, a postback is fired and the value of the file control becomes null. in the code i need to get the content length and read it using an object stream. but, since the file.value is null, it gives an error at the object stream code. how do i retain the value in the file control. if there any other way in which i can get these values as we cannot set the value of a file control.
|