This is a discussion on how to access local file from server? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Can we able to access the local file to JavaScript or VB Script? If no then how the browser write ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Can we able to access the local file to JavaScript or VB Script? If no then how the browser write the cookie value in client side? |
|
#2
| |||
| |||
| hi, it is possible when the server is your local machine. i think using javascript we can't do any file handling. The cookies are maintained by the browser.
__________________ With, J. Jeyaseelan Everything Possible |
|
#3
| |||
| |||
| Hi, you can do that with using ActiveX to access local file. By using Script.FileSystemObject but almost all browser IE doesn't activate the ActiveX, so you must turn it on in your browser. |
|
#4
| |||
| |||
| Hi tecquilla, I enable the activex in IE like below 1. In Internet Explorer > Tools > Internet Options > Security > Custom Level 2. Enabling or prompting "Initializing and Script Activex controls not marked as safe" Code: function WriteToFile() { try { var fso, s; alert(1) fso = new ActiveXObject("Scripting.FileSystemObject"); alert(2) s = fso.CreateFolder("C:\\test.txt", true); alert(3) s.writeline("This is a test"); alert(4) s.Close(); alert(5) } catch(err) { alert(err) var strErr = 'Error:'; strErr += '\nNumber:' + err.number; strErr += '\nDescription:' + err.description; document.write(strErr); } } WriteToFile(); But when i execute this scipt it throws the error "Error: Number:-2146827838 Description:Wrong number of arguments or invalid property assignment" How to solve this? |
|
#5
| |||
| |||
| Quote:
That is s = fso.CreateTextFile("c:\\test.txt", true); It will work |
|
#6
| |||
| |||
| Thanks Vims, Its working fine in IE But not in firefox. Do you have any idea? |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Accessing local file system in Flash | Karpagarajan | Flash Actionscript Programming | 2 | 08-05-2008 02:45 AM |
| Access To Local Disk | seesamjagan | Flash Actionscript Programming | 1 | 02-24-2008 08:34 PM |
| Pass the client's local time to a server side process | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 02-20-2008 08:51 PM |
| Importing mysql dump file to my Local Server | Murali | Database Support | 1 | 12-12-2007 06:10 AM |
| Difference between a file and Random access file Classes | anbuchezhians | Java Programming | 1 | 08-08-2007 01:53 AM |
Our Partners |