/    Sign up×
Community /Pin to ProfileBookmark

Autopopulate path in file upload box

I have a process that autopopulates 1 to 50 different file upload boxes pending how many are required (this part is driven by asp and works fine). However, currently the user has to browse each and every file and then hit upload. I know what each filename and path is for the user (they use the labtop I set up for them and a program I wrote in VB also).

So, currently I have a text box populated to the left with the filepath autopopulated, and a blank file upload box next to it. They currently copy and paste the filepath on the left into the box on the right.

So, how in the heck can I have that path autopopulate in the file upload box?

[url]http://www.msultd.com/upload_file.htm[/url] illustrates what I wish to happen.

Here is my code:
<html>
<head>
<title>I want this box to say c</title>
</head>
<body>
<form>
I want this box to say c:program filesmsufile.jpg<p>&nbsp;</p>
<p>
<input type=”file” size=”15″ name=”file_upload”>
</p>
<p>
I can do this on a text box:</p>
<p>
&nbsp;
<input type=”text” size=”50″ value=”c:program filesmsufile.jpg”></p>
</form>
</body>
</html>

So, basically, I am looking for something like the value= of a text box for a file upload; however, I don’t think there is one in html…if there is, please, oh please tell me…if not, is there a way in javascript to autopopulate the file I wish to upload?

edit:

If I can’t do this, then is there a way to simplify the copy and paste for my users? Place a copy button on the screen which will copy the text box, then a paste button which will paste it into the file upload box? Or, at least a copy button? Thanks!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Aug 18.2005 — For security reasons we can not manipulate the value of a file input. We can only read the value.

Eric
Copy linkTweet thisAlerts:
@dzirkelbauthorAug 18.2005 — Thats what I thought...is there any easier way that anyone can think of to upload a file of which I already know the path for?
Copy linkTweet thisAlerts:
@dzirkelbauthorAug 18.2005 — Is there a way to do a check on the value of the file upload box to ensure it matches the text box to the left of it? I am assuming sometime a user will copy and past and miss a letter, causing them to try to upload a file which doesn't exist.
×

Success!

Help @dzirkelb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...