Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


getting files on clientside

Posted on 2011-10-18
Medium Priority
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
  • 3
LVL 61

Accepted Solution

HainKurt earned 1000 total points
ID: 36988086
you cannot do anything like that in js

Author Comment

ID: 36988095
hmm how can I do that than?
LVL 28

Assisted Solution

strickdd earned 1000 total points
ID: 36988222
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

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

Author Closing Comment

ID: 36988291
thanks guys

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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!
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses

577 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