getting files on clientside

Posted on 2011-10-18
Last Modified: 2012-05-12
string folder = Server.MapPath("/Attachments/" + lblattachment.Text.ToString());
                        string[] filePaths = Directory.GetFiles(folder);
                        string result = Path.GetFileName(filePaths[0]);
                        System.IO.FileInfo targetFileInfo = new System.IO.FileInfo(filePaths[0]);

How can I do that same thing on client side with javascript? to get the file...just like above code...
Question by:1jaws
    LVL 51

    Accepted Solution

    you cannot do anything like that in js

    Author Comment

    hmm how can I do that than?
    LVL 28

    Assisted Solution

    The best you can do is use a java-applet or flash pluggin and even with those you are sandboxed. Can you imagine if javascript had access to the entire file system? Someone could write a web page that simple uploaded your browser's password file without you even doing anything but loading the page.

    Author Comment

    :) you are soo right, didnt think about this part

    Author Closing Comment

    thanks guys

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now