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 6083571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:25:06+00:00 2026-05-23T11:25:06+00:00

I display a file open box so the user can select a file on

  • 0

I display a file open box so the user can select a file on their computer:

<input type="file" id="upload_input"/>

but when I get the file the user chose in Javascript (see code below), which I believe is ‘safe’ since javascript executes on the client side — all I get is the file, not the full path — despite the fact that the full path and filename appear in the field next to the ‘Browse’ button that input type=file always gives you.

In other words the user selects a file located on his machine for example at c:/aFolder/thefile.rtf.
Then after choosing that file the full path appears in the field next to the ‘Browse’ button: c:/aFolder/thefile.rtf

Yet when I programmatically retrieve the value of that field, the entire path is stripped off and all I have is the filename:

filename = document.getElementById('upload_input').value;
alert("The selected file name is " + filename);

Why does the input type=file control even bother to show the user the full path if you can’t get it programmatically?
It’s all happening on the client side after all, it’s not like this is a full path on the server.

One other question: I use the filename above and construct a fully qualified path to that file, only for the sake of getting my JWplayer code working. The full path I create for development here is temporary.

In otherwords, when I get the filename above, I do this:

vidFname = ("c:/xampp/htdocs/theWebsite/aFolder/" + filename);
alert("The full path is: " + vidFname);

and then I try to play the video in Jwplayer:

playlist = { file: vidFname };

theJwPlayer().load(playlist);
theJwPlayer().play(true);

but Jwplayer gives me “Permission denied or file not found.”

Here is what I had to change to get this to work:

vidFname = ("http://localhost/theWebsite/aFolder/" + filename);
alert("The full path is: " + vidFname);
playlist = { file: vidFname };
theJwPlayer().load(playlist);
theJwPlayer().play(true);

By changing the path to my localhost the above code works — the video loads and succesffully plays.

NOTE: I don’t think this is a ‘folder permissions’ issue because I can play the exact same file in the same location with a different .FLV player (standalone) app on my computer. So it’s not folder permissions in my c:/xampp that’s making Jwplayer say ‘permission denied or file not found.’

Why won’t Jwplayer (or is it Javascript..?) not letting me use a fully-qualified pathname to the file when I call
jwplayer().load() ?

After all, I’m using ‘theJwPlayer’ in Javascript,’ which is running on the client computer, and the file is on the client computer too, so it’s not a security issue.

Or is there something I’m missing here? NOTE: I fully apologize if this question is ignorant but at my current level of web programming, which you may have passed LONG ago, this is puzzling, ESPECIALLY the jwplayer().load() not working with a fully qualified path name.

  • 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-05-23T11:25:07+00:00Added an answer on May 23, 2026 at 11:25 am

    Browsers will not reveal actual file paths to JavaScript code. It’s a security thing. You won’t be able to get at local files without using the (new, only available in new browsers) HTML5 file handling APIs, and even those won’t give you complete file pathnames.

    Similarly, when the file input is submitted with a form, the server won’t get the full path either.

    I think it’s not very likely that this media player tool you’re working with is designed to work with local files (that is, files on the local file system where the browser is running).

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

Sidebar

Related Questions

The code chokes at fopen(): <?php ini_set('display_errors',1); error_reporting(E_ALL); $fp = fopen(/path/to/file/some_file.txt,a) or die(can't open
On Windows the user has an option to display/hide file extensions when viewing files.
I'm creating a xml-file for display in Excel using _di_IXMLDocument. But for some tags
I'd like to have my VBScript display the Windows Save As dialog box, but
I want to reverse the contents of the input file and display the reversed
I need a solution to display open file dialog in HTML while clicking a
I want to display a file tree similarly to java2s.com 'Create a lazy file
I'm trying to display standard file/directory context menu in WinForms application - I'd like
I have some source codes to display all file names in a UITablView I
I've got a tiny bit of code to display a file in app.yaml -

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.