admin管理员组文章数量:1401158
I want to make some file operation using Javascript or jQuery like:
- File create
- File write
- File read
- Update
- Remove/delete
Is it possible to do above stuffs? If possible, from where I can get the idea? Please suggest me.In any end (client/server) how can it be done?i asked this just for know!
I want to make some file operation using Javascript or jQuery like:
- File create
- File write
- File read
- Update
- Remove/delete
Is it possible to do above stuffs? If possible, from where I can get the idea? Please suggest me.In any end (client/server) how can it be done?i asked this just for know!
Share Improve this question edited Apr 24, 2011 at 13:18 thecodeparadox asked Apr 24, 2011 at 13:04 thecodeparadoxthecodeparadox 87.1k22 gold badges142 silver badges164 bronze badges 6- Where - on client side, or on server side? What is your end goal with this? – Pekka Commented Apr 24, 2011 at 13:07
- 2 Assuming you're talking about in the browser: Thank god you can't. If you can, malicious scripts can, too. – user395760 Commented Apr 24, 2011 at 13:07
- @delnan hi friend. i'm not finding these for any malicious purpose. So if you predict something like that, you are wrong.Thanks for your ment. – thecodeparadox Commented Apr 24, 2011 at 13:34
- @Pekka hi bro, on client and both server side both. I want to know this not for malicious purpose.Dont't predict something like that. Help me.As a new programmer its my curiosity. – thecodeparadox Commented Apr 24, 2011 at 13:35
- 1 I'm not saying you have malicious intents. But browser JS runs in a sandbox for a reason - incredible potential for malware otherwise (heck, even with the sandbox people find ways to abuse it!). – user395760 Commented Apr 24, 2011 at 13:36
3 Answers
Reset to default 2There are 2 HTML5 APIs of interest.
The File API which allows you to read files (of a users choice). Most modern browsers implement this.
The File Write API which allows you to write to files. No browsers implement this as of now.
I presume you can also use IE only ActiveX controls to do file manipulation on windows.
In any end (client/server)
You weren't specific about which server side JS implementation you are using, so for Node.js:
See the file system section of the Node.js documentation
As I can understand from your question you are trying to do file operation at client end. If you are using IE and windows operating system, you can do that using FileSystemObject. This doesn't work for other browser and other operating systems as FileSystemObject is ActivexObject given by Windows. For details refer http://www.codeproject./KB/scripting/JavaScript__File_Handling.aspx
本文标签: File operation using Javascript or jQueryStack Overflow
版权声明:本文标题:File operation using Javascript or jQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744232961a2596425.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论