Forums
This topic is locked
FSO Objects
Posted 14 Feb 2004 09:39:38
1
has voted
14 Feb 2004 09:39:38 Daniel Burns posted:
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:<script language="vbscript">
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
</script>
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?
Replies
Replied 16 Feb 2004 01:36:32
16 Feb 2004 01:36:32 Phil Shevlin replied:
Replied 16 Feb 2004 10:48:45
16 Feb 2004 10:48:45 Daniel Burns replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
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:
<script language="vbscript">
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
</script>
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 (Including Windows Script 5.6) 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?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
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:
<script language="vbscript">
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
</script>
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 (Including Windows Script 5.6) 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?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>