Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-28-2012, 03:22 PM   PM User | #1
xaverian
New Coder

 
Join Date: May 2012
Posts: 46
Thanks: 3
Thanked 0 Times in 0 Posts
xaverian is an unknown quantity at this point
How to access and delete a file in javascript

Hi ,

My requirement is to access a file(in unix) from my javascript funtion.

Let us assume , I have the following javascript function :

function deleteFile()
{

var file = "dest.txt" ;



}

Now this file is inside a directory in my present directory.
My present directory say, /home/myuser/
The dest.txt file is under a directory my_dir in my present directory.

How can I then access it as /home/myuser/my_dir/dest.txt and delete the same.

Please help. Thanks
xaverian is offline   Reply With Quote
Old 08-28-2012, 04:24 PM   PM User | #2
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,234
Thanks: 11
Thanked 157 Times in 157 Posts
DrDOS is infamous around these parts
Javascript doesn't allow access to the file system, for security reasons. It can only link to files of the .js extensions, or modify the code of the current page, and then only for the browser session.
DrDOS is offline   Reply With Quote
Old 09-08-2012, 05:14 PM   PM User | #3
jalarie
Regular Coder

 
Join Date: Jun 2002
Location: Flint, Michigan, USA
Posts: 595
Thanks: 1
Thanked 20 Times in 20 Posts
jalarie is an unknown quantity at this point
You should be able to do this using Visual Basic Script, but ONLY from within the Internet Explorer browser.

I've done it on a Windows machine, but I don't have unix to test it. Sorry.
__________________
Visit my site at http://spruce.flint.umich.edu/~jalarie/.
jalarie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:09 AM.


Advertisement
Log in to turn off these ads.