Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. FSO FileSystemObject

FSO FileSystemObject

Scheduled Pinned Locked Moved Visual Basic
comhelpsecuritydebuggingtools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    djbugzy
    wrote on last edited by
    #1

    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?

    H 1 Reply Last reply
    0
    • D djbugzy

      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?

      H Offline
      H Offline
      Hesham Amin
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups