473,473 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1923
<%
'// 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.