Normally, we do follow all file operation at Server Level.
Sometimes, we got requirement from Clients to save file at local machine, create folder at Specific path, delete temporary file or folder, etc..
We can use FileSystem Object which is provided by IE.
It will work in Internet Explorer Only.
We can not use the same feature for other browsers as they do not provide FileSystem Object.
There are number of methods that we can use for File Operations.
1. CreateFolder()
Syntax: filesystemobject.CreateFolder(name)
This method used to create a new folder at client machine. use the following code snippet to implement the same for your application.
2. CreateTextFile()
Sometimes, we need to store some data which we need to use for further operation, at that time, we create a local file at client location. for that CreateTextFile is useful which helps to create a file at client machine.
Syntax: filesystemobject.CreateTextFile(filename, overwrite)
Overwrite is a boolean value which indicates whether you want to overwrite the existing file.
use the following snippet example for more clarification.
The same way there are many methods which is used for file operation at client side.
for more details please visit: More Methods
3. BuildPath()
4. CopyFile()
5. CopyFolder()
6. DeleteFile()
7. DeleteFolder()
8. DriveExists()
9. GetAbsolutePathName()
10. GetBaseName()
11. GetDrive()
12. Drives()
13. FileExists()
14. FolderExists()
15. GetDriveName()
16. GetExtensionName()
17. GetFile()
18. GetFileName()
19. GetFolder()
20. GetParentFolderName()
21. GetSpecialFolder()
22. MoveFile()
23. MoveFolder()
24. OpentextFile()
Sometimes, we got requirement from Clients to save file at local machine, create folder at Specific path, delete temporary file or folder, etc..
We can use FileSystem Object which is provided by IE.
It will work in Internet Explorer Only.
We can not use the same feature for other browsers as they do not provide FileSystem Object.
There are number of methods that we can use for File Operations.
1. CreateFolder()
Syntax: filesystemobject.CreateFolder(name)
This method used to create a new folder at client machine. use the following code snippet to implement the same for your application.
<html>
<body>
<script language="JScript">
<!--
function create()
{
var myObject, newfolder;
myObject = new ActiveXObject("Scripting.FileSystemObject");
newfolder = myObject.CreateFolder ("c:\\newtmp\\");
}
-->
</script>
<form name="myForm">
<input type="Button" value="Click to Create New Folder" onClick='create()'>
</form>
</body>
</html>
2. CreateTextFile()
Sometimes, we need to store some data which we need to use for further operation, at that time, we create a local file at client location. for that CreateTextFile is useful which helps to create a file at client machine.
Syntax: filesystemobject.CreateTextFile(filename, overwrite)
Overwrite is a boolean value which indicates whether you want to overwrite the existing file.
use the following snippet example for more clarification.
<html>
<body>
<script language="JScript">
<!--
function createFile()
{
var myObject, newfile;
myObject = new ActiveXObject("Scripting.FileSystemObject");
newfile = myObject.CreateTextFile("c:\\testing.txt", false);
}
-->
</script>
<form name="myForm">
<input type="Button" value="Click to Create New File" onClick='createFile()'>
</form>
</body>
</html>
The same way there are many methods which is used for file operation at client side.
for more details please visit: More Methods
3. BuildPath()
4. CopyFile()
5. CopyFolder()
6. DeleteFile()
7. DeleteFolder()
8. DriveExists()
9. GetAbsolutePathName()
10. GetBaseName()
11. GetDrive()
12. Drives()
13. FileExists()
14. FolderExists()
15. GetDriveName()
16. GetExtensionName()
17. GetFile()
18. GetFileName()
19. GetFolder()
20. GetParentFolderName()
21. GetSpecialFolder()
22. MoveFile()
23. MoveFolder()
24. OpentextFile()