/    Sign up×
Community /Pin to ProfileBookmark

input type="file"

Hi all.

I have an exist page with an INPUT type=file element.

It upload object with a text box and Browse button.

<input type=”file” name=”file_pathname” size=”35″>

I want to set a value manually, like this:
document.forms[0].file_pathname.value = ‘c:fileName.txt’

But it doesn’t work!!

Can you help me??

Thanks a lot

David

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@JonaMay 17.2005 — [font=Trebuchet MS]You can&#8217;t, because doing that would be insecure. I could steal any file from your computer automatically without you even knowing about it.[/font]
Copy linkTweet thisAlerts:
@bezaleliauthorMay 18.2005 — Thanks a lot.

Do you have any other idea?
Copy linkTweet thisAlerts:
@JonaMay 18.2005 — [font=trebuchet ms]How about just asking someone to select a file from their hard drive on their own?[/font]
Copy linkTweet thisAlerts:
@bezaleliauthorMay 18.2005 — I am ++ programmer. I have built an Internet Explorer Component that serve as the browser you already know. I can to load any page on it and to simulate an user actions by javaScript commands that I am writing in my C++ program. I do not tuch the page.

i using my program to configure a Network devices with HTTP interface (like AccessPoints,act..). to do so, I am using the DOM in those page.

So I came up with this input, called 'file'.

Do you have any idea for me?

If it is not possible' please tell me why.

I am not a web master.

Thank a lot

David
Copy linkTweet thisAlerts:
@JonaMay 18.2005 — [font=trebuchet ms]If you&#8217;re programming Internet Explorer components, you might be able to override the restrictions put on &#8216;file&#8217; inputs, but under normal circumstances JavaScript cannot interact with &#8216;file&#8217; inputs.[/font]
Copy linkTweet thisAlerts:
@bezaleliauthorMay 19.2005 — Thanks a lot

DAVID
×

Success!

Help @bezaleli 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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