By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,246 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,246 IT Pros & Developers. It's quick & easy.

Access file system with HTML

P: n/a
Hi

Is it possible to do basic file system access within HTML?
I want to be able to do the following tasks to a known full path and
filename

Delete (with warning prompt if possible)
Open
Open containing folder
Get the files properties

The html documents is a local html file generated by a script that searches
for certain files based on a file pattern (*.tmp, *.bak, *.wbk etc) and
builds a html documents which I would like to use as a front end to managing
the files it has reported on. The html document will not be running on a
web server, only on a network drive.

Thanks
Jul 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a

"Paul Ponting" <pa**********@hotmail.com> wrote in message
news:br**********@hercules.btinternet.com...
Hi

Is it possible to do basic file system access within HTML?
I want to be able to do the following tasks to a known full path and
filename

Delete (with warning prompt if possible)
Open
Open containing folder
Get the files properties

The html documents is a local html file generated by a script that searches for certain files based on a file pattern (*.tmp, *.bak, *.wbk etc) and
builds a html documents which I would like to use as a front end to managing the files it has reported on. The html document will not be running on a
web server, only on a network drive.

Thanks


HTML doesn't do anything but lay out text and graphics files. If you mean,
can you do all these things with scripting, then that would be a question
for a scripting (or Javascript) newsgroup.

Jul 20 '05 #2

P: n/a
"Paul Ponting" <pa**********@hotmail.com> wrote in
news:br**********@hercules.btinternet.com:
Hi

Is it possible to do basic file system access within HTML?

<snip>

no, HTML is client side and you need service side processing. You need to
use perl, php, or other server side scripting language.

--
Edward Alfert - http://www.rootmode.com/
Discount Code (Recurring 25% Off): newsgroup
Multiple Domain Hosting * Reseller Hosting
Free IP Addresses * Private Label Nameservers
Jul 20 '05 #3

P: n/a
Paul Ponting wrote:
Hi

Is it possible to do basic file system access within HTML?
I want to be able to do the following tasks to a known full path and
filename

Delete (with warning prompt if possible)
Open
Open containing folder
Get the files properties


Have a look at:
http://msdn.microsoft.com/workshop/a...taoverview.asp

Andrew Graham
Jul 20 '05 #4

P: n/a

"Andrew Graham" <an*********************@nospam.invalid> wrote in message
news:p_**********************@bgtnsc05-news.ops.worldnet.att.net...
Paul Ponting wrote:
Hi

Is it possible to do basic file system access within HTML?
I want to be able to do the following tasks to a known full path and
filename

Delete (with warning prompt if possible)
Open
Open containing folder
Get the files properties


Have a look at:
http://msdn.microsoft.com/workshop/a...taoverview.asp


I love this line from there:

"Internet Explorer is so forgiving that even the missing html and body tags
do not cause an error. "

1. Accepting bad code is a feature!!!

2. Guess what, Microsoft: the html and body tags--both opening and
closing--*are* optional in an HTML document. So it's a *good thing* that
their absence doesn't cause an error, because otherwise that would be one
*more* deviation from the standard.

Jul 20 '05 #5

P: n/a
In article <br**********@hercules.btinternet.com> in
comp.infosystems.www.authoring.html, Paul Ponting wrote:
Is it possible to do basic file system access within HTML?
I want to be able to do the following tasks to a known full path and
filename

Delete (with warning prompt if possible)


HTML is not a programming language. It is a way to mark op the
structure of documents so that a program (typically a Web browser)
can display the text in an appropriate way.

HTML can't do _anything_ to affect the viewer's system.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #6

P: n/a
"Paul Ponting" <pa**********@hotmail.com> wrote in
news:br**********@hercules.btinternet.com:
Hi

Is it possible to do basic file system access within HTML?
I want to be able to do the following tasks to a known full path and
filename

Delete (with warning prompt if possible)
Open
Open containing folder
Get the files properties

The html documents is a local html file generated by a script that
searches for certain files based on a file pattern (*.tmp, *.bak,
*.wbk etc) and builds a html documents which I would like to use as a
front end to managing the files it has reported on. The html document
will not be running on a web server, only on a network drive.


Not that I think it's the best approach, but you can accomplish
what you want to do without doing "file system access within HTML".

You already have some sort of scripting provision, and you presumably
have something to render HTML. If your existing script generates
HTML that has URLs of the form
http://your.local.webserver/filetode...t?somefile.tmp
then so long as you have webserver software setup on the system
that will be using the generated HTML, where the webserver software
understands that you want it to execute the "filetodelete.script" file
and pass it the query string "somefile.tmp", then you can do it.

Currently, you are just using HTML as the means to format(i.e. markup)
the data in the report produced by the existing script. Why not use
the scripting language's features(if it has them) to interact with the
user in regards to what to do with the files, or use a different
scripting language, etc.

--
Dave Patton
Canadian Coordinator, the Degree Confluence Project
http://www.confluence.org dpatton at confluence dot org
My website: http://members.shaw.ca/davepatton/
Vancouver/Whistler - host of the 2010 Winter Olympics
Jul 20 '05 #7

P: n/a
Andrew

Thanks for this insight, I had never heard of HTA's
After a brief look on the web, I have managed to convert the output html
file into a working HTA file which basically just emulates exactly what the
html did (i.e. just markup)

I have done a search but cannot find code that will allow me to delete a
file, open the containing folder of a file or access the file properties.

The file format is

\\servername\volume\folder\file.ext
Any ideas?

"Andrew Graham" <an*********************@nospam.invalid> wrote in message
news:p_**********************@bgtnsc05-news.ops.worldnet.att.net...
Paul Ponting wrote:
Hi

Is it possible to do basic file system access within HTML?
I want to be able to do the following tasks to a known full path and
filename

Delete (with warning prompt if possible)
Open
Open containing folder
Get the files properties


Have a look at:
http://msdn.microsoft.com/workshop/a...taoverview.asp

Andrew Graham

Jul 20 '05 #8

P: n/a
Paul Ponting wrote:
"Andrew Graham" <an*********************@nospam.invalid> wrote in
message
news:p_**********************@bgtnsc05-news.ops.worldnet.att.net...
Paul Ponting wrote:
Is it possible to do basic file system access within HTML?
Have a look at:
http://msdn.microsoft.com/workshop/a...taoverview.asp
Andrew Graham

Andrew

Thanks for this insight,
You're welcome!
I have done a search but cannot find code that will allow me to
delete a file, open the containing folder of a file or access the
file properties.

Any ideas?


Sample code:
function Delete(filespec) {
var fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFile(filespec);
f.Delete();
}
...
<body onload="Delete('c:\all\my\important\information.tx t')">

These pages will get you started, and closely linked pages have sample
code:

<http://msdn.microsoft.com/library/de...y/en-us/script
56/html/vtoriMicrosoftWindowsScriptTechnologies.asp>

<http://msdn.microsoft.com/library/de...y/en-us/script
56/html/jsobjfile.asp>

I'd say we're off topic now. if you have more questions you should head
over to one of the Microsoft scripting groups.

Andrew Graham
Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.