473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Server.Mappath Help

Y2K
I have a thumbnail viewer which displays images on a webpage.
Currently, the images reside in a subfolder of the root, and this works
fine. I understand the main problem here is my limited knowlege of
ASP.

Here's the current setup:
c:\testproj\imageviewer = Virtual directory named "IMGviewer"
c:\testproj\imageview\upload\pics = folder that contains images
The following code works:
ImageConn = "pics/"
Set fso = CreateObject("Scripting.FileSystemObject")
'Set fattributes = fso.GetFolder(server.mappath(""&ImageConn&""))
The problem is, the images are in another folder:
c:\testfolder\myimages\pics_5
I've tried the following, and get a "path not found" error.
Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5\")
Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5")
Set fattributes =
fso.GetFolder("//servername/c$/testfolder/myimages/pics_5")
Set fattributes =
fso.GetFolder("//servername/c$/testfolder/myimages/pics_5/")
Can anyone tell me what I'm doing wrong? Thanks.
Y2K

Jun 26 '06 #1
3 2351
On Mon, 26 Jun 2006 15:28:02 -0700, Y2K
<Y2*@discussions.microsoft.com> wrote:
I have a thumbnail viewer which displays images on a webpage.
Currently, the images reside in a subfolder of the root, and this works
fine. I understand the main problem here is my limited knowlege of
ASP.

Here's the current setup:
c:\testproj\imageviewer = Virtual directory named "IMGviewer"
c:\testproj\imageview\upload\pics = folder that contains images
The following code works:
ImageConn = "pics/"
Set fso = CreateObject("Scripting.FileSystemObject")
'Set fattributes = fso.GetFolder(server.mappath(""&ImageConn&""))
The problem is, the images are in another folder:
c:\testfolder\myimages\pics_5
I've tried the following, and get a "path not found" error.
Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5\")
Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5")
Set fattributes =
fso.GetFolder("//servername/c$/testfolder/myimages/pics_5")
Set fattributes =
fso.GetFolder("//servername/c$/testfolder/myimages/pics_5/")
Can anyone tell me what I'm doing wrong?


Trying to access a folder with an incorrect path. :)

Most likely the folder in question doesn't have permission for the
account accessing it.

Jeff
Jun 27 '06 #2
Y2K


"Jeff Cochran" wrote:
On Mon, 26 Jun 2006 15:28:02 -0700, Y2K
<Y2*@discussions.microsoft.com> wrote:
I have a thumbnail viewer which displays images on a webpage.
Currently, the images reside in a subfolder of the root, and this works
fine. I understand the main problem here is my limited knowledge of
ASP.

Here's the current setup:
c:\testproj\imageviewer = Virtual directory named "IMGviewer"
c:\testproj\imageview\upload\pics = folder that contains images
The following code works:
ImageConn = "pics/"
Set fso = CreateObject("Scripting.FileSystemObject")
'Set fattributes = fso.GetFolder(server.mappath(""&ImageConn&""))
The problem is, the images are in another folder:
c:\testfolder\myimages\pics_5
I've tried the following, and get a "path not found" error.
Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5\")
Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5")
Set fattributes =
fso.GetFolder("//servername/c$/testfolder/myimages/pics_5")
Set fattributes =
fso.GetFolder("//servername/c$/testfolder/myimages/pics_5/")
Can anyone tell me what I'm doing wrong?


Trying to access a folder with an incorrect path. :)

Most likely the folder in question doesn't have permission for the
account accessing it.

Jeff


Ok.. not having permissions is fine.. I can fix that. What's the correct
path? Are you saying I'm getting that error because the path cannot be found
due to insufficient permissions?

Y2k
Jun 27 '06 #3
sashi
1,754 Expert 1GB
hi there,

what is the error msg? pls paste the error msg on ur next post.. :)

coz i find that troubleshooting is alot more easier when u know the error number as well as the error message.. i prefer these way..
Jun 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: John Rebbeck | last post by:
I've got the directory f:\Company\Product set as web shared so it's got a virtual directory in the default web site on my test server's IIS. If I try to use Server.MapPath in that site it returns a...
4
by: Laphan | last post by:
Hi All Sorry to be irate, but the whole concept of Server.MapPaths really has me in a tiswas!! In order to confirm once and for all, could you please advise me on the following: 1) There...
7
by: Elie Grouchko | last post by:
Hi I am running exactly the same ASP code on IIS 5.0 and IIS 6.0 I am calling Server.MapPath(), the parameter is a virtual path that includes a reference to a parent path...
3
by: MattB | last post by:
If I use server.mappath to get to the root dir of my application from within codebehind, it works fine. I also want to use this from a vb class I have in my application, and I think I have an issue...
6
by: darrel | last post by:
I have some functions that are reading/writing to the file system. As such, they use server.mapPath a lot to navigate it all. Since I'm using these functions numerous times throughout my...
7
by: benoit | last post by:
Hi, if I write this code to retrieve a folder on the server Server.mappath("/DATA") I get this error message System.InvalidOperationException: Failed to map the path '/DATA' the virtual...
4
by: vunet.us | last post by:
How to use server.mappath() parent folder correctly: Server.MapPath("../test.asp") Thank you for the hint.
3
by: rn5a | last post by:
Server.MapPath returns the physical file path that corresponds to the specified virtual path whereas Request.MapPath maps the specified virtual path to a physical path. Assuming that a file named...
6
by: withers | last post by:
If I run Server.MapPath("/") on my operational Internet server I get, correctly, the physical path to the directory my page is in (d:\.... \...\htdocs). If I run Server.MapPath("/") on my...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have one line code in my program, occasionaly I will receive the following error: "The Path parameter for the MapPath method did not correspond to a known path" ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.