View Full Version : creating folders
08-26-2005, 04:56 PM
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 & "\")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if NOT objFSO.FolderExists(strFolderPath) then
Set objFSO = Nothing
08-26-2005, 05:12 PM
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
08-26-2005, 05:52 PM
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.
08-26-2005, 09:43 PM
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?
08-27-2005, 02:26 AM
Well you can't refer to a path like C:\myfolder\ on a remote machine by using the IP address first.
You could try:
use a UNC path cuz there isn't any such thing as http://66.255.x.x/\c:\etc\
08-27-2005, 01:35 PM
i still dont understand why the images would need to be put on the sql server machine instead of the iis6 machine..
08-29-2005, 01:20 PM
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.