File Field issue!

This is a discussion on "File Field issue!" within the Classic ASP section. This forum, and the thread "File Field issue! are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old May 16th, 2005, 15:32
New Member
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
File Field issue!

Hello!

I have a problem with hidden fields. On my form (HTML/ASP) I have a hidden field (called hf1), a button (called b1) and a file field (called ff1). When I click on the "browse" button in the file field, I can browse for any file on my computer. I want that whenever I click on the button (b1), the hidden field (hf1) should get ONLY the file name I browsed without the path. For example:

If I browse and the file field shows the following path: c:\temp\abc.doc
When I click on the button (b1) I want the hidden field (hf1) to get only
abc.doc and not the rest of the file path. How can I do that?

Please I would really appreciate your help, I tried a lot of sites in order
to get some help but some gave me URL's to check out and they were
irrelevant to my questions, some could not give me an answer and I really need to solve this problem.

Thank you in advance,
SimpleGuy!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old May 16th, 2005, 16:15
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
ive never done this before, but this is how i would do it - might be completely wrong!

i would get the path of the file into a variable, look for the last "/" in it, and chop off everything before and including that "/"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old May 16th, 2005, 17:26
New Member
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
File Field issue!

Hello Benbacardi!

Thank you for the reply. How could I chop the path from the file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old May 16th, 2005, 17:49
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Code: Select all
' spath = the full path to your file
fname = right(spath,len(spath)-instrrev(spath,"/"))
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old May 16th, 2005, 17:59
New Member
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
File Field issue!

Hello Catalyst!

Thank you for your reply as well. I checked your code and it resembles to what I have done. The only difference is that in the line:
spath = the full path to your file
I do not hard code the file path. I did something like this:

spath = request.form("file1")
and it generated me an error message. I need the variable spath to get the path that's in the file field. It has to be dynamic.

Thank you in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
file, field, issue

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
XAMMP my file issue longstand Databases 0 Dec 10th, 2007 21:09
Links in a txt file not showing in dynamic text field Darren600 Flash & Multimedia Forum 8 May 9th, 2007 15:48
looping issue with flash file snooper Flash & Multimedia Forum 9 Nov 20th, 2006 13:34
Working with Form 'file field' data in ASP. daryl Classic ASP 3 Jun 24th, 2006 20:22
file field in ASP page lameneural Classic ASP 18 Dec 8th, 2005 11:46


All times are GMT. The time now is 13:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42