Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7723433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:26:32+00:00 2026-06-01T04:26:32+00:00

From my research, I know that I cannot use HTML input file to get

  • 0

From my research, I know that I cannot use HTML input file to get the directory pathname. However, I tried an alternative method where I store the value of the input file into a hidden field and pass the stored value to my back end codes for further processing.
Javascript code:

<script type="text/javascript">
function folder_address()
{
    var address=document.getElementById('folder_address');
    var folder=document.getElementById('folder');
    folder.value=address.value;
}
</script>

HTML code:

<input type="file" id="folder_address" name="folder_address" />
<input type="hidden" id="folder" name="folder" />

However, I still get folder.value as the file that I selected and not the full directory pathname of the file. Did I miss out anything?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:26:34+00:00Added an answer on June 1, 2026 at 4:26 am

    This behavior isn’t meant to be circumvented. Even if you could find a loophole using script/additional fields, the loophole would likely be removed in the future.

    I would strongly suggest a design that does not rely on knowing the local path which the user has selected.

    It would be a security flaw to reveal a user’s directory structure to the server (think c:\users\tmedora in Windows; now you know my user name). In addition, file systems can format paths differently and users are free to name/rename directories as they wish. I’m not sure what value a full path would have to the server. Unless you are in an extremely controlled environment, you have no guarantee that you will even be able to parse the path, let alone count on it containing consistent information.

    The W3 specifically states that including the full path is a security vulnerability and requires that user agents prepend the string c:\fakepath\ to file paths.

    Some legacy user agents actually included the full path (which was a
    security vulnerability).

    Also see IE Gives full path, FF gives only filename (or directory browse) and
    How to get the full path of the file from a file input and many others.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a data mining research project and use code from a big
After making some research, I now know that I can launch an iphone app
There is an .fla file that has a sound wave in it's library. However
Firstly, I have done my research and already know that JavaScript = client JSPs
I've done some research on using tags from social bookmarking sites for web search
I’m looking at creating a P2P system. During initial research, I’m reading from Peer-to-Peer
From a WCF service we get a quit complex reponse with multiple nested lists
From the question here , There are two external libraries to use for http
I've never really used MS server or anything like that before, i have, however
On my busiest production installation, on occasion I get a single thread that seems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.