View Full Version : deleting files
gibby
08-30-2002, 01:57 AM
ive managed to get file upload working but I cant work out how to delete files
im using this code, I dont get any errors when I run the page but when I click on the delete button I justs hangs
function DeleteFile(filespec)
{
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
fso.DeleteFile(filespec);
}
thats the code from the msdn webby, im using classic asp not asp.net.
any help anyone ??
whammy
08-30-2002, 11:44 PM
Do you have permissions set to delete files on that server? That could be why it's hanging...
gibby
08-31-2002, 03:01 PM
yeah I should have I havnt up'ed the site yet its just running on local host, so i use 127.0.0.1/whatever to access it so there shouldnt be a problem.
gibby
08-31-2002, 04:50 PM
ive been playing around with the FileSystemObject and anything I do with it causes a time out. I dont know what im doing wrong and im using the code from the msdn site so I really dont know whats going on.
Ive tried creating files, deleting files etc etc but nothing works.Heres some of the code I tried
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\testfile.txt", true);
a.WriteLine("This is a test.");
a.Close();
that was directly from the microsoft page on a page with this on it
<%@ Language=JavaScript %>
<%var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\testfile.txt", true);
a.WriteLine("This is a test.");
a.Close();
%>
<td>hello</td>
so there isnt anything else to go wrong but still it times out.
whammy
09-01-2002, 01:52 AM
Lots of people seem to be having problems with that lately. I don't use it much, but perhaps there is a problem with the new patch?!
I wish I could help more...
gibby
09-01-2002, 11:52 PM
ive found out what it is, norton antivirus causes the script to time out. You have to disable script protection then reset the computer.
Microsoft dont have to much info on their site about it funnily enough and it took me ages to sort it out, but if anyones having the same problem just do that and it will be be fine.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.