FSO FileSystemObject
-
I am able to do Upload a file (or copy it) and name it with a variable (moving from a local local to the website) with the following code in the script editor (Frontpage) using the CopyFile Path fso method: Sub Submit_OnClick Dim Path Dim TheForm Dim NewFolder Set TheForm = Document.UploadForm NewFolder = TheForm.UserName.Value Dim fso Dim PictureName Set fso = CreateObject("Scripting.FileSystemObject") PictureName = TheForm.PictureName.Value If IsNull(UploadForm.PictureName.Value) = False Then fso.CopyFile Path, "C:\Inetpub\wwwroot\ADI\FileUploads\" & NewFolder & "" & PictureName & ".bmp" Else End If End Sub But when I go to preview it in the actual browser I get this message: A Runtime Error has occurred Do You Wish to Debug? Error: ActiveX component can't create object 'Scripting.FileSystemObject' I've been advised that this is caused by security settings and that most PC's are set up this way Apparantly fso's infringe on security because you have access to files on the hard drive I've been to all the windows sites and downloaded MDAC 2.1 or better and the latest scripting engines from microsoft's website, one person even advised uninstalling and reinstalling Frontpage, which I did to no avail. It seems to be actually quite an apidemic, if you tpye in the above error in google.com you get a slew of results. Well, I'm wondering if there's a more secure way for users to upload files besides using an FSO Can anyone help me?
-
I am able to do Upload a file (or copy it) and name it with a variable (moving from a local local to the website) with the following code in the script editor (Frontpage) using the CopyFile Path fso method: Sub Submit_OnClick Dim Path Dim TheForm Dim NewFolder Set TheForm = Document.UploadForm NewFolder = TheForm.UserName.Value Dim fso Dim PictureName Set fso = CreateObject("Scripting.FileSystemObject") PictureName = TheForm.PictureName.Value If IsNull(UploadForm.PictureName.Value) = False Then fso.CopyFile Path, "C:\Inetpub\wwwroot\ADI\FileUploads\" & NewFolder & "" & PictureName & ".bmp" Else End If End Sub But when I go to preview it in the actual browser I get this message: A Runtime Error has occurred Do You Wish to Debug? Error: ActiveX component can't create object 'Scripting.FileSystemObject' I've been advised that this is caused by security settings and that most PC's are set up this way Apparantly fso's infringe on security because you have access to files on the hard drive I've been to all the windows sites and downloaded MDAC 2.1 or better and the latest scripting engines from microsoft's website, one person even advised uninstalling and reinstalling Frontpage, which I did to no avail. It seems to be actually quite an apidemic, if you tpye in the above error in google.com you get a slew of results. Well, I'm wondering if there's a more secure way for users to upload files besides using an FSO Can anyone help me?
In client side scripting you can't access the file system this is very harmfull for internet users I read about *.hta applications (web pages hosted in browser) that can do this. But I have no more info about them.