Solved

"File Field" form element not working (ASP.VB/MS Access)

Posted on 2003-11-10
9
521 Views
Last Modified: 2010-04-25
I have a record insertion page that allows the user to input the date on which a MS Word document was created. I want the user to also insert a hyperlink to this document, which resides on the same server as the web site and database.

Rather than making them hand-code the link, I'd like them to be able to "browse" for it from the record insertion page, and once the page submits the hyperlink will be in the database.

I'm trying to use the "file field" form element from the DW form behaviors, but as soon as I put the "file field" in, the form no longer submits. If I just have the date text field, the form populates the database with the date. As soon as I put the file field in, the form no longer submits. I don't even have any insert behavior assoviated with it - just the act of putting it in the form causes the form to no longer work.

Help?
0
Comment
Question by:stewboy
9 Comments
 
LVL 23

Expert Comment

by:adilkhan
ID: 9723503
stewboy You cant just use the FILE field like this.

file field is good if you want to UPLOAD files to your server into a Specific Folder AND you have 3rd Party Component's installed on your Server to accept file Field Upload. http://aspUpload.com is a good website to learn about using File upload's.

if you want your users to input the URL then let them Type it, thats the Best solution without using Filefield. otherwise get the Component to accpet file upload's.
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 9723641
> I posted this question, but it makes no sense, and no one will be able to provide me with a logical, working answer.

stewboy what do you mean by it makes no sense?
I gave you the Answer to your question, that you trying to do something and its not quit possible, if you think you are confused OR you think i am wrong then please continue the Post to ask more questions about your problem.
0
 

Author Comment

by:stewboy
ID: 9725059
Not trying to duck you adilkhan. I asked to have it pulled before I  saw that you had posted a Comment. The reason I asked for it to be pulled is that I'm trying to use the file field for something it's not designed to do.

I'm looking for a way that a user can browse for the location of a document, and then input that link to the database, where it will reside as a hyperlink. What the file field button is doing, at least superficially, is exactly what I want.  I don't actually want the file to be uploaded, just the link information.

However, just because I want it to do something doesn't mean it actually will.

Can you help me find another way to allow user "browsing" for a file location?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 23

Expert Comment

by:adilkhan
ID: 9725423
Thanks for Clearification.
Thats not quite possible because of Security Reasons.
0
 

Expert Comment

by:shoeman22
ID: 9726680
I haven't tested this out, but it may work:
The idea is that you can use the <input type="file"> element to display the location of the file, then, when you submit the form, you can trigger a JavaScript function to pass the text value from the "file" input box into a "hidden" field.

Then, when you submit it to the server, you will be able to reference the hidden field, containing the url of the "file" field, just like you would any other text field.
--------------------------------------------------------------------------------------------
<script language="javaScript">
function setHidden(theFileField,theFileName) {
     theFileName.value=theFileField.value;
}
</script>


<form action="form.asp method="post" name="myForm" onSubmit="setHidden(this.myFile,this.myFileName);">
<input type="file" id="myFile" name="myFile">
<input type="hidden" id="myFileName" name="myFileName">
<input type="submit">
</form>

--------------------------------------------------------------------------------------------
Let me know if you need any more help,
shoeman22
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 9728127
shoeman22 I know what you mean.
But the Problem is FILE field has many Security Issues, You can not set the Value of the Hidden Field from the File field VIA Client Side Language such as javaScript.
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 9755276
PAQed, with points refunded (125)

SpazMODic
EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now