Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to Persist HtmlInputFile Value through postback?

Reply
Thread Tools

How to Persist HtmlInputFile Value through postback?

 
 
Dave Adler
Guest
Posts: n/a
 
      02-18-2004
Is there any way to retain the value of an HtmlInputFile control through a
postback?

I do some server side validation on the page when it is submitted and if an
error occurs on the page the HtmlInputFile control value is blank after the
postback. The EnableViewState for the control is set to true. I can't put
the postedFile.filename value in a hidden control and then put it back into
the HtmlInputFile control on postback because the postedFile.filename and
the value properties are read-only.

Any ideas?

Thanks in advance

David


 
Reply With Quote
 
 
 
 
Patrice Scribe
Guest
Posts: n/a
 
      02-18-2004
No for security reasons.

You could probably still perhaps do tricky things such as using (inline)
frames (allowing to keep a part that doesn't get refreshed).

Patrice

--

"Dave Adler" <> a écrit dans le message de
news:...
> Is there any way to retain the value of an HtmlInputFile control through a
> postback?
>
> I do some server side validation on the page when it is submitted and if

an
> error occurs on the page the HtmlInputFile control value is blank after

the
> postback. The EnableViewState for the control is set to true. I can't put
> the postedFile.filename value in a hidden control and then put it back

into
> the HtmlInputFile control on postback because the postedFile.filename and
> the value properties are read-only.
>
> Any ideas?
>
> Thanks in advance
>
> David
>
>


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-18-2004
Hi,

no there isn't as this is security related (if you could write to it, you
could theoretically upload files from client without user knowing that)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Dave Adler" <> wrote in message
news:...
Is there any way to retain the value of an HtmlInputFile control through a
postback?

I do some server side validation on the page when it is submitted and if an
error occurs on the page the HtmlInputFile control value is blank after the
postback. The EnableViewState for the control is set to true. I can't put
the postedFile.filename value in a hidden control and then put it back into
the HtmlInputFile control on postback because the postedFile.filename and
the value properties are read-only.

Any ideas?

Thanks in advance

David



 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      02-18-2004
you shouldn't do much serverside validation on HtmlInputFile , as the file
is actually uploaded, you shouldn't require a second upload. at least cache
the file, and do secondary processing after.

-- bruce (sqlwork.com)


"Dave Adler" <> wrote in message
news:...
> Is there any way to retain the value of an HtmlInputFile control through a
> postback?
>
> I do some server side validation on the page when it is submitted and if

an
> error occurs on the page the HtmlInputFile control value is blank after

the
> postback. The EnableViewState for the control is set to true. I can't put
> the postedFile.filename value in a hidden control and then put it back

into
> the HtmlInputFile control on postback because the postedFile.filename and
> the value properties are read-only.
>
> Any ideas?
>
> Thanks in advance
>
> David
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resetting the value of a System.Web.UI.HtmlControls.HtmlInputFile Nathan Sokalski ASP .Net 8 05-23-2006 09:21 PM
Initial value of HtmlInputFile Dotnet ASP .Net 2 01-13-2005 03:50 PM
Re: HtmlInputFile losing value after postback bruce barker ASP .Net 0 08-04-2004 04:18 PM
HtmlInputFile.value cleared after submit. Lau Lei Cheong ASP .Net 3 05-19-2004 02:28 AM
Cant set value of HTMLInputFile control Mark ASP .Net 2 11-09-2003 07:37 PM



Advertisments