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.
|
|
|
|
|
![]() |
||
File Field issue!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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! |
|
|
|
#2
|
||||
|
||||
|
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 "/" |
|
#3
|
|||
|
|||
|
File Field issue!
Hello Benbacardi!
Thank you for the reply. How could I chop the path from the file? |
|
#4
|
|||
|
|||
|
|
#5
|
|||
|
|||
|
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. |
![]() |
| Tags |
| file, field, issue |
| Thread Tools | |
|
|
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 |