Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2003
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question creating folders

    Hi i have a folder creation issue, can't seem to create a folder named "bird" on a remote sql2000 server (i have the correct premissions set on the remote server)... am i do this correctly?

    Dim CID, strFolderPath

    CID = "bird"

    strFolderPath = Server.MapPath("http://66.255../server_name/\c:\" & CID & "\")

    Dim objFSO

    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

    if NOT objFSO.FolderExists(strFolderPath) then
    objFSO.CreateFolder(strFolderPath)
    end if
    Set objFSO = Nothing

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    i dont think you can set server.mappath to an external absolute url, what happens when you write this:

    Response.Write Server.MapPath("http://66.255../server_name/\c:\" & CID & "\")

    and whats with the /\c:\ etc.. that doesnt make sense..

    Server is objects about the server that iis is running on, MapPath() changes a relative virtual path into an absolute physical path of the server its on

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Yeah, I am similarly confused as ghell.

    The create folder method will only create folders that have a standard path to them, at least in my experience. I don't think UNC paths will work either.
    OracleGuy

  • #4
    Regular Coder
    Join Date
    Mar 2003
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    this is what i'm trying to do:

    Server #1 = IIS6
    Server #2 = sql2000 at a remote location

    currently #1 creates a table and column headings in the db of #2
    This table is going to be used to store paths to image files on the same machine

    These images will be stored in folders with a set naming convention. As #1 creates the table in #2 i would also like to beable to create the folders for the image files.

    any thoughts on this? can it theoritically with VB/asp? what about with store procedures?

    thanks
    Last edited by havey; 08-26-2005 at 09:56 PM.

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Well you can't refer to a path like C:\myfolder\ on a remote machine by using the IP address first.

    You could try:

    \\66.255.x.x\<share name>\myNewFolder

    use a UNC path cuz there isn't any such thing as http://66.255.x.x/\c:\etc\
    OracleGuy

  • #6
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    i still dont understand why the images would need to be put on the sql server machine instead of the iis6 machine..

  • #7
    Regular Coder
    Join Date
    Sep 2004
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In agreement with ghell, since the IIS machine is going to be the one using/displaying the images, you would be better off storing them on it. If the images are going to be small in size, you could also store the images in your sql server database in binary fields. I will caution you on this as if the images are large in size or you are pulling a bunch of them back at one time, you could run into latency issues. I worked with a CMS (Content Management Software) that initially stored any files under 2 MB in the database in a binary field. However, b/c our users turned this application into more of a document warehouse, the db became very inefficient due to the sure size and volumn of files that were stored as binary data in the database.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •