Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2004, 02:52 AM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get the File Path

Hi,
I'm new with ASP NET and I need some help, please.
I need a way to search (browse) for a file (an input type=file tag) and after i select the file to pass that value to an ASP control (asp:textbox). I'm not interested in the content of the file, just the filename and path. If i use runat=server for the input tag, i have a problem with large files (when i do the post back i gat a "Page cannot be displayed" error.

Thank


 
Old October 6th, 2004, 10:23 AM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sPath = Server.MapPath(".")
sFile = txtFileName.PostedFile.FileName

 
Old October 29th, 2004, 02:24 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you browse to a large file, that large file will get posted with the web request. This is why you are having problems. If you want to only get the name of the file, you'll have to roll your own control, or use a combination of the file input type and some other things.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve Active File Path francois.timms Excel VBA 3 March 24th, 2008 05:14 PM
how to call file using full path labby C# 2005 4 September 27th, 2006 11:25 PM
Knowing File Path x_ray VB.NET 2002/2003 Basics 8 February 15th, 2006 04:12 PM
Getting path of the file zorglub76 C# 4 December 23rd, 2005 04:25 AM
Get File path maxpotters Excel VBA 4 April 6th, 2005 01:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.