A
André
Hi,
Is it possible to create directories and files with asp.net?
Thanks
André
Is it possible to create directories and files with asp.net?
Thanks
André
André said:Hi,
Is it possible to create directories and files with asp.net?
Thanks
André
Is it possible to create directories and files with asp.net?
Mark said:Yes, with some caveats...
ASP.NET can use the System.IO namespace like any other .NET technology.
However, this will allow it to create files and or folders server-side, so
long as it has sufficient permissions to do so. Depending on how you have
your web app and/or IIS configured, the default account that ASP.NET runs
under may not have sufficient permissions to write to the server's file
system...
What ASP.NET can't do is work with the client browser's file system, at
least, not natively. If you're hoping to create a folder on the client's
hard disk, you're only option would be to write a Java applet or an ActiveX
control - not recommended...
Actually, with the right permissions, JavaScript also can manipulate the
FileSystem. There is no standard implementation in the browsers, so it's a
bit complex, but I use this in HTA applications running locally, it's
handy.
See
http://www.galasoft-lb.ch/myjavascript/CExplorer/index.html
Mark said:Oh come on, Laurent! Of course you can "try" to run client-side scripting,
but who in their right mind is going to allow that to proceed, especially on
a public website!!!
The first thing this did was throw an "Automation server can't create
object" error - a quick glance at the line which threw the error revealed it
to be:
var fso = new ActiveXObject( "Scripting.FileSystemObject" );
Do you honestly think I was going to allow any client-side script beginning
with that line to continue to run...?
![]()
Of course you weren't ;-) But then you also won't allow a Java applet or
an ActiveX to do that either, right? This was only in reaction to the
"Java or ActiveX" comment in your post.
My point is: JavaScript can be used for other things than over http. I use
HTAs often because they're easily programmed, because I love writing
JavaScript code and because using JavaScript to automate Excel, Outlook,
etc... is really much nicer (to me) than using VBA.
Indeed.
(in case you don't know, you can save any HTML with a HTA extension. It
will then run on any Windows PC with IE installed with the same rights as
a normal EXE application).
Mark said:Yes - that can be useful if you don't care about cross-browser
compatibility...