PDA

View Full Version : Browse button and upload file


barryb1
07-03-2002, 03:16 AM
Hello everyone, I'm new to your forum so if I do something wrong the first time, take it easy on me.
I have 2 questions to ask.
1. Does anyone know how to change the name on the browse button from browse to another name with javascript or any other language. The button I'm talking about is when you use a form button and the input type is "file". An Example would be to locate a file on someones hard drive.

2. I have a project at work where I need to create a button that can do the same function as a browse button to get a file off the hard drive without the input area. What the user needs to do is click on this button to locate a file on their drive, and after they select the file and hit the button on the mini window (I think it's "Open" or "OK") it will begin the upload or import function.

Your help would be greate on this subject.

Thanks everyone

glenngv
07-03-2002, 03:35 AM
1. not possible
2. not possible

adios
07-03-2002, 03:40 AM
<html>
<head>
</head>
<body>
<form onsubmit="alert(file1.value)">
<input name="file1" type="file" style="position:absolute;visibility:hidden;"
onchange="file2.value=this.value">
<input type="text" name="file2">
<input type="button" onclick="file1.click()" value="barryb1">
<input type="submit" value="TEST">
</form>
</body>
</html>

Your second Q is a bit unclear (to me, anyway)...considerable security surrounds most aspects of browser access to local files, for obvious reasons. More details might help. Check here:

http://www.faqts.com/knowledge_base/index.phtml/fid/177

barryb1
07-03-2002, 03:42 AM
If there is one thing I know about code is, nothing is impossible. It just hasn't been done yet.
I know I've seen question 1 on the web before, I jst can't remember where. And question 2, well I need help on that one but I was told it can be done with some work.

barryb1
07-03-2002, 03:51 AM
Thanks Adios
What I'm tring to do in question 2 is have a pop-up window open when the user click upload, and after they select the file that they want uploaded the process will start without having to click anything else. An example would be what yahoo does when you import an address book (a csv file) to their address book.

The link that you sent me was good I will try them if I can't get an answer here.

mwidholm
05-09-2006, 03:44 PM
Thanks for this post. It got me much closer to my answer. The answer to question #1 is here:
http://www.faqts.com/knowledge_base/view.phtml/aid/6003/fid/177