SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool browse and select local files and pas on as variable to create link and open file

    Hi,
    I am new to Java. I am trying to get people to browse a directory on our network with video files and choose the file and play it.
    I got the browsing part of it working but i woud like to create a variable (the name of the file chosen) that is past on to be opened as
    a linked file. I tried the following code but i don't seem to have gotten this right. I am not sure what i am doing wrong, can somebody point met
    in the right direction?

    Thanks a lot Buzz

    <html>


    </HEAD>
    <BODY>


    <form method="GET" name="form">

    Name: <input name="filebrowser" type="file" value="">

    <input name="Submit" type="submit" value="Submit">

    </form>


    <script type="text/javascript">

    <a href="var=filebrowser" onclick="javascript:document.form.submit();"></a>
    </SCRIPT>

    </body>
    </html>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by baslightyear View Post
    I am new to Java. I am trying to get people to browse a directory on our network with video files and choose the file and play it.
    I got the browsing part of it working but i woud like to create a variable (the name of the file chosen) that is past on to be opened as
    a linked file. I tried the following code but i don't seem to have gotten this right. I am not sure what i am doing wrong, can somebody point met
    in the right direction?
    If you are wanting to do Java stuff, you'll need to get assistance with that from elsewhere. JavaScript (originally called LiveScript) is a very different language from Java, and both serve completely different purposes.
    What is JavaScript and how is it different from Java Technology?

    Quote Originally Posted by baslightyear View Post
    I am trying to get people to browse a directory on our network with video files and choose the file and play it.
    I got the browsing part of it working but i woud like to create a variable (the name of the file chosen) that is past on to be opened as
    a linked file. I tried the following code but i don't seem to have gotten this right. I am not sure what i am doing wrong, can somebody point met
    in the right direction?
    When it comes to JavaScript, I don't think that web browsers provide the path of the file to scripting engines, as a security measure. Only the filename itself.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •