Uploading files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a file type input on my page in a VB.Net version 2 web application:

<input id="AddReport" type="file" name="AddReport" runat="server" />

Is there anyway to set the default directory in code that it goes to on
Browse?

Thanks.
 
Gerhard said:
I have a file type input on my page in a VB.Net version 2 web application:

<input id="AddReport" type="file" name="AddReport" runat="server" />

Is there anyway to set the default directory in code that it goes to on
Browse?

Thanks.
No as value property is readonly due to security reasons.

Hope this helps
 
Thanks. Is there a way to set it in development in the tag? I don't see any
properties that do it.
 
Hi Gerhard,

For the file upload control (html input file element) in html web page, as
Milosz has mentioned, the path/value of the file upload html element can
only be specified by client user interactively. Any programmatic approach
such as using javascript or server-side code to supply the initial value is
not allowed(the client browser will prevent such supplied value from
working). Here is a knowledge base article describe this behavior:

#PRB: Cannot Use Script to Manipulate INPUT TYPE=File Value
http://support.microsoft.com/kb/266087/en-us

BTW, if you do need powerful control over the file uploading from client to
your web application, I suggest you consider using some rich client
solution such as:

** embeded ActiveX to upload file

** embeded .NET winform usercontrol to upload file


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top