473,230 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

Help.. how to browse to file and create hyperlink in database

I have a form where a user enters their name, date etc.
i also want them to be able to click on a browse button and select a
file which will then appear in a textbox. when they press submit i
want the file name and path to be put into the database. e.g.
"C:\windows\work\work.doc". Basically I don't want to UPLOAD the file
just enable the user to browse to it and send the filename and path to
the database.

Any help would be appreciated,

thanks
Jul 19 '05 #1
5 1911
<%
'// eg.asp
strFile = Request.Form("TheFile")
Select Case strFile
Case ""
%>
Show your form here
<%
Case Else
'// Add your processing code here to add strFile to the
database.
End Select
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Jon D" <go********************@spamgourmet.com> wrote in message
news:a7**************************@posting.google.c om...
I have a form where a user enters their name, date etc.
i also want them to be able to click on a browse button and select a
file which will then appear in a textbox. when they press submit i
want the file name and path to be put into the database. e.g.
"C:\windows\work\work.doc". Basically I don't want to UPLOAD the file
just enable the user to browse to it and send the filename and path to
the database.

Any help would be appreciated,

thanks

Jul 19 '05 #2
<<
I have a form where a user enters their name, date etc.
i also want them to be able to click on a browse button and select a
file which will then appear in a textbox. when they press submit i want
the file name and path to be put into the database. e.g.
"C:\windows\work\work.doc". Basically I don't want to UPLOAD the file
just enable the user to browse to it and send the filename and path to
the database.


Here is a test file that works for me:

<html>
<body>

<%
' If there was a post.
If Request.Form.Count > 0 Then
Response.Write "LName = " & Request.Form("LName") & "<br>"
Response.Write "FileLocationOnClientPC = " &
Request.Form("FileLocationOnClientPC") & "<br>"
Else
%>
<form id="frmMain" name="frmMain" action="<%=
Request.ServerVariables("SCRIPT_NAME") %>" method="post">
LName: <input type="text" name="LName"><br>
FileLocationOnClientPC: <input type="file"
name="FileLocationOnClientPC"><br>
<input type="submit" name="btnSubmit" value="Submit"><br>
<%
End If
%>

</form>
</body>
</html>

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Thanks ever so much for your help but I have a problem with the
example you gave me and can't work out which parts wrong!
" method="post">
This part is displayed on the webpage rather then being part of the
form header. I've tried changing all different parts of the script but
to no avail. Im sure its something simple but I can't see it.

thanks
Bullschmidt <pa**@bullschmidt.com-nospam> wrote in message news:<#0**************@TK2MSFTNGP09.phx.gbl>... <<
I have a form where a user enters their name, date etc.
i also want them to be able to click on a browse button and select a
file which will then appear in a textbox. when they press submit i want
the file name and path to be put into the database. e.g.
"C:\windows\work\work.doc". Basically I don't want to UPLOAD the file
just enable the user to browse to it and send the filename and path to
the database.


Here is a test file that works for me:

<html>
<body>

<%
' If there was a post.
If Request.Form.Count > 0 Then
Response.Write "LName = " & Request.Form("LName") & "<br>"
Response.Write "FileLocationOnClientPC = " &
Request.Form("FileLocationOnClientPC") & "<br>"
Else
%>
<form id="frmMain" name="frmMain" action="<%=
Request.ServerVariables("SCRIPT_NAME") %>" method="post">
LName: <input type="text" name="LName"><br>
FileLocationOnClientPC: <input type="file"
name="FileLocationOnClientPC"><br>
<input type="submit" name="btnSubmit" value="Submit"><br>
<%
End If
%>

</form>
</body>
</html>

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4
This should all be one line of code:

<form id="frmMain" name="frmMain" action="<%=
Request.ServerVariables("SCRIPT_NAME") %>" method="post">

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5
Bullschmidt wrote on 01 jul 2004 in
microsoft.public.inetserver.asp.general:
This should all be one line of code:

<form id="frmMain" name="frmMain" action="<%=
Request.ServerVariables("SCRIPT_NAME") %>" method="post">


This will also do:

<form id="frmMain"
name="frmMain"
action="<%=Request.ServerVariables("SCRIPT_NAME")% >"
method="post">

And even this will do the same:

<form id="frmMain"
name="frmMain"
method="post">

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rob | last post by:
Help me, I'm just beginning with programming in Access 2000. I've tried the http://www.mvps.org/access/api/api0001.htm but it won't work in Access. What am i doing wrong. I don't have...
1
by: Rob | last post by:
Hi there, I'm just beginning with programming in Access 2000. I use the API call for browsing to a file. The result is placed in a field defined as hyperlink. But when i click on the hyperlink...
5
by: Maria Joćo | last post by:
I have a table with one field that ia a hyperlink to a pdf file that opens a specific file. Since these files are very big, I would need to change the hyperlink path, so that I could send the...
0
by: Matthew | last post by:
I have designed a database that allows you to manage all the words for songs. So the user opens the database they can either add a song to the list by entering the SongCode, SongName and they...
3
by: Chris | last post by:
I have an access database that we share on a public drive. Also there is a folder in the same drive that has PDF documents. On my computer, I can pull up the PDF document off the hyperlink but on...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: Dulwich | last post by:
As a Newbie to VBA, I've just had a successful conclusion to a protracted struggle with attempts to open a browse window that allows one to find a file and have that file's path saved in a bound...
4
by: mark4asp | last post by:
I want to write a xslt template to create a xhtml 1.0 (transitional) file which will be sent in as email. Here is a typical xml data file: <BatchEmail> <Domain>www.myDomain.com</Domain>...
1
by: alnino | last post by:
Hi, On a form I have a command button that allows a user to browse for a file (PDF, Word, etc…). This command button then stores a hyperlink to the file within an associated txtfield in the table....
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.