Anyway To Use MapPath With Server.Execute?
I need to use Server.Execute for dynamic includes. My files are located in different folders and what works for one doesn't work for another. I need to include the full path to the file because relative paths do not work. Can someone tell me how to do something like this:
Server.Execute(Server.MapPath("./") & "includessubnavigationdefault.asp")
I keep getting this error:
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.
The problem is I NEED to use relative URLs some how.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
MapPath With Server.Execute
I need to use Server.Execute for dynamic includes. My files are located in different folders and what works for one doesn't work for another. I need to include the full path to the file because relative paths do not work. Can someone tell me how to do something like this: Server.Execute(Server.MapPath("./") & "includessubnavigationdefault.asp") I keep getting this error: Invalid URL form or fully-qualified absolute URL was used. Use relative URLs.The problem is I NEED to use relative URLs some how.
Server.MapPath
Set objFile = objFSO.GetFile(Server.MapPath(strFileName)) this line brings up this error: ---------- Error Type: Microsoft VBScript runtime (0x800A0035) File not found /Turbomaster/presupuesto_confirm.asp, line 67 ------------ the variable strFileName is being read correctly..
Server.MapPath
there is an image folder in my root directoty containing images. When I run the following code from a file located in root directory, the file gets deleted. But when I put the file in some other folder, it generates error FILE NOT FOUND. aND YES, i'VE TRIED BOTH fso.deletefile(server.mappath("Images/"&photo)) fso.deletefile(server.mappath("/Images/"&photo)) <% dim fso photo="902392.jpg" set fso = Server.CreateObject("Scripting.FileSystemObject") fso.deletefile(server.mappath("Images/"&photo)) %>
Server.MapPath()
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 ("Root/Files/../Config/"). 'Config' is a virtual directory under 'Root' which is also a virtual directory. 'Files' is a normal folder. Under IIS 5.0, the path is correctly mapped to the local path of the 'Config' virtual directory. Under IIS 6.0, the path gets mapped to "C:WebSiteRootFiles..Config", ignoring the 'Config' virtual directory mapping. Is there a special setting I should be aware of in IIS 6.0 to ensure correct mapping of virtual paths?
Server.mappath.
I just don't understand it and I know I must be over complicating things. strCon= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("diary.mdb") but then I create a new folder called for instance 'database' and move my diary.mdb into it(with full permissions), what do I change the server.mappath to?
Server.mappath
My web site has three folders: htdocs logs private I want to access an MS Access database in the 'private' directory from scripts within the 'htdocs' folder. Part of my connection string reads: Data Source=" & Server.MapPath("../private/test.mdb") But the page returns the following error: Could not find file '[my web site]htdocsest.mdb' Why is it still looking in the 'htdocs' folder when my connection string points to the 'private folder?
Server.Mappath()
If I have multiple websites on the same server,can I use the #include directive to reference include files elsewhere on the server? I tried this - <!--#include file="C:InetpubvhostsATRAMEMBER.COMhttpdocsheader.asp" --> But no dice...
Server.MapPath
The Windows OS allows commas in file/folder names but if you try to call .Code: Server.MapPath("/smith, john/") your application will neatly halt and provide you with an error report.Other than telling your site/network users not to use commas as allowed in the OS what can the application designer do to avoid the error.I am sure a kludgey workaround is to scan for the comma, change the file/folder name to something safe then restore the name at the end. I don't think this is a safe way to do things though.
Server.MapPath
Code: <%=Server.MapPath(rsCurrImgs("nvcLinkPath"))%> Gives a strange error. When I do it like this: rsCurrImgs("nvcLinkPath")it works fine. What can it be? Quote: Error Source: NULL Category: Server.MapPath() Description: Invalid Path Character Full Description: An invalid character was specified in the Path parameter for the MapPath method.
Server.mappath
if you have an address /dir/wwwroot/andy and you use server.mappath("/dir/andy") you recieve the physical path , i.e. c:.inetpub/wwwroot/dir/andy is there a way of going the other way ie from a physical path to a virtual path?
Server.mappath
I'm trying to create a log file of users accessing my site. This I can do on the current server using server.mappath, but I can't figure out how to write to a file on a different server.
Server.mappath
I'm trying to use the server.mappath function on a web site hosted on win 2000 professional. Is this feature not on win 2000 pro? It simply produces 'page not found' Code:
Server.MapPath Alternative?
I have an asp file that gathers info from a form and sends to the database. im now changing the location of the database from the root path. I think that because of this i cannot use Server.MapPath method of sending data. Coudl someone please help me out and let me know how i would change the code? Im quite new to this as you could probably see. Code:
Server.MapPath Error
I just took up the task of learning ASP, done all the hello world stuff and then thought about the DB side of things and thought that a login system would be a nice place to start, so naturally I started with the registration page, and asp page to do the actual DB stuff, but it would seem I have a prob with Server.MapPath. So I edited my Register page to test and sure enough it doesn’t work, but it works when I make a page with just a .Write of the Server.MapPath Code:
Server.MapPath Error
I have a project where multiple sites in separate folders use the same db. My dbconn include file is causing this error. Server.MapPath() error 'ASP 0173 : 80004005' Invalid Path Character /rboggs/fu/fu021/assign6/includes/dbconn.asp, line 9 An invalid character was specified in the Path parameter for the MapPath method. here is my code [hightlight="ASP"] <% Dim cnnEXDB I have no clue what is wrong here any help would be greatly appreciated
Server.Mappath Command
In my root folder, there is a folder "Images". I need to check whether there is a file named 23.jpg in it or not. I am using the following code but it's returning false. The file is in the folder. <% Set fs=Server.CreateObject("Scripting.FileSystemObject") x="23.jpg" If fs.FileExists(Server.Mappath("/Images/"&x)) = true Then Response.Write("File Exists.") Else Response.Write("File Does Not Exists") End If set fs=nothing %>
Server.mappath Method
I need to map a path to my database file automatically, if I move the application to a different direcotry level I still have to write part of the path to get the application to work. Is there anyway I can translate the directory path and place inside the mappath function so I dont have to manually edit it? cst = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("shopsmartnetworkcartcart.mdb")
Changing Server.MapPath
I have just changed host and I need to change my Server.MapPath to comply with my new host db folder . Currently I have my path set to Server.MapPath("db/access.mdb") but I need to move it back up a few folders so it is above the "www" folder in the new hosts specified db folder. How do I achieve this?
Server.MapPath() Doesn't Work
I have to upload my senior project to the school's sytem. My asp pages are all in one directory so there is no directory structure. At home I just reference my database file as Code: Server.MapPath("mydb.mdb") But it won't work on the school's system saying it can't find the database file. I've tried "mydb.mdb" and ".mydb.mdb", but it still won't find it. I'm just wanting to make sure that, those are the only ways you can reference your db. I've sent and email to the admin, but he doesn't answer his emails. (What an admin!) I'll have to talk to him in person about it then. Suggestions till then?
Server.mappath AND FileSystemObject
How can I make the commented out code work ? (Its clear what I'm trying to do) Set filecol = filesys.getfolder("D:/Files/Apps").files 'Set filecol = filesys.getfolder(server.mappath("testingpage/storage")).files
Passing String To Server.MapPath
How can I pass the results of a form field submitted to this statement below? <% Set MyFileObj = Server.CreateObject("Scripting.FileSystemObject") '### This Works '###Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath("body.txt")) '### This Doesnt work Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath(" & request.form("MyFileName") & ")) WHILE NOT MyTextFile.AtEndOfStream Response.Write(MyTextFile.ReadLine & Chr(10)) WEND MyTextFile.Close %>
How To Get DB Connection Using Server.MapPath To Work Everywhere?
I have a site with the directory structure like this: wwwroot (where the default.asp and other pages sit)inc (where the includes are)login (where login pages are)otherDirs (where other pages are)datafiles (where database is) I usually hard code the db connection path but want to use the MapPath now in case in the future my site moves servers (have been though that and having to manually change all db connection strings - Not Fun ) Code:
Delete File - Server.MapPath Problem
What's wrong with this code? Thie file is there, why cant it find it? <% myfile = request.querystring("filename") response write myfile myFSO.DeleteFile(Server.MapPath(" & myfile & ")) SET myFSO = NOTHING %> OUTPUT: data/000000/index.htm Microsoft VBScript runtime error '800a0035' File not found /deletefile.asp, line 9
Server.MapPath Returning Wrong Path
I've got the directory f:CompanyProduct 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 path within c:Inetpubwwwroot rather than the real path. Can anyone please tell me why this isn't working?
Server.execute/response.redirect/server.transfer
Real quick, please refresh my memory which one of the following preserves the information that was posted from a form? server.execute server.transfer response.redirect I need to have a page execute if an error occurs while processing a page that a form was submitted to and have the data preserved.
Error Server.Transfer / Server.Execute ()
Any one has Idea, How to use Server.Transfer and Server.Execute, When I tried to use these methods I got an eror: Server object error 'ASP 0230 : 80004005' Server.Transfer Error /SISWeb/portal_logon.asp, line 40 The call to Server.Transfer failed while loading the page. anybody is there who can respond to this problem. Do I need to change any setting at IIS?
Server.Transfer Vs. Server.Execute
i'm using a model, view, control architecture for a group of .asp pages. i can't decide whether to use Server.Transfer or Server.Execute to pass posted data from my control to my model. are there security implications for using Server.Execute? just wanting some advice on pros/cons to each of these since this is the first time i'm attempting to use these methods.
Server.execute Permissions On Server
I have a website and use server.execute quite extensively. The website was put into production and at first all worked great. but some users were getting to my site but an error message would pop up stating page was not loaded properly. TO many users it looks like the website simply does not exsist. What happens is that when the web page (www.cheapbatterypacks.com/main.asp) gets executed it will fail for "some" people at the server.execute point. Here is a good example of the problem. In my shop I have 3 computers on the same network. connected to a dsl connection etc. All have internet access all run IE6 etc. 2 will pull up www.cheapbatterypacks.com just fine. but 1 will not. maybe some of you will see the same error. if you type www.cheapbatterypacks.com/loosecells.asp it will pull up fine but that file is supposed to be loaded by the server.execute function and not run on its own. so now I am pulling my hair out to try and get these other folks on board and working. How would something be so selective like this. COuld it be me webserver settings? And even if it was how come it appears to only affect some people. This is a public website so there are no logins/passwords etc meaning they come in a anonymous and have only read/execute permissions. I am still running windows 2000 server with all Sp's patches etc. IIS 5.0.
Server.execute
i hope no one is getting sick of my server.execute/transfer questions.. does server.execute return a value? im wondering what happens if an error occurs in the .asp file that i'm calling with the server.execute command?? is there a value/flag i can set in the case of an error that can be seen once i return to the calling page? if not i was thinking that i would have to use a session variable for my error handling. i want to stay true to the model, view, control architecture so i don't want to simply redirect in the case of an error - i want to send a value back to my control page which will decide where to go.
Server.Execute
In file '1.asp' I call Server.CreateObject("a") to create an instance of object 'a'. I then call Server.Execute("2.asp") and want to pass the reference to the object 'a' I just created to the script executing in '2.asp'. Session cookies are not enabled so there is no session object. Does anyone know if there is any documented way of doing that? or if there is a good/right solution to this problem?
Server.Execute
I use server.execute in a table and I dont wannt to change the sizes of table so I want to use scrolling bar but how can I do it.
Server.execute ?
Can server.execute provide a return value? How? ie. dim test test = server.execute("page2.asp") What code in page2.asp will produce something in test?
Server.execute
Is it possible to use sever.execute and the on the called page use another server.execute (if some condition is met) It has failed in my experiments
Server.execute
I've got an include file inside each page throughout my site. Inside this include file I'm running server.execute to include other pages based on a condition (userID). The problem has two parts- 1) The CPU usage jumps up to 100% 2) The path for these include files is different according to the file that is calling server.execute, resulting in an invalid path I'm not sure the best way to go about this. Basically all I'm trying to do is run server.execute from within an include file, regardless of where the calling page is inside my site structure. This will be running off of an IIS 5 box and is being tested with IIS 6.
Server.Execute() &
In Page1.asp I am calling Server.Execute("Page2.asp"). Before calling Server.Execute(), I set an application variable to a value that it is important for me to know that it doesn't get accessed by another ASP page before I call Application.unlock in Page2.asp, that is why I use Application.lock. According to the documentation, Application.lock gets automatically unlocked when the ASP page terminate, I want to confirm that calling Server.Execute() doesn't automatically unlock the application, i.e that Page2.asp will start executing when the application is still locked.
Server.execute
I have some code which I use server.Execute. In the included code for the server.execute, if I use a Request variable I get an error stating that I cannot use request after UPL but If I change all the variable names from request to upl, it tells me that UPL is not defined. It seems that the page is passing the form values for request but not UPL
Server.Execute
I am calling Server.Execute("2.asp") from "1.asp" and expect to have application variables declared in "1.asp" available to the script code in "2.asp", at least this is what the documentations says, but it doesn't work. I am declaring the variables in "1.asp" as public (VBScript). Does anyone have an idea if this is supposed to work?
Server.Execute
I would like one ASP program to execute another ASP program and then continue execution with the first ASP program. According to “Beginning Active Server Pages 3.0” from Wrox, the following code should work: Server.Execute "ups_trans_send_ds.asp" However, I’m getting the following error message: Object doesn’t support this property or method: Server.Execute I’m using Personal Web Server 4.0 on Windows NT (with Service Pack 6)
Server.execute
I want to make a web page in which I would include first header from header.html(it works fine),then sql connection subs from sql.asp,then variables from config.asp and so on. when I write include for those asp files it doesn't seem to read them (no variables can be read)and when i try using server.execute,it shows me their content like in normal html files.I've tried to find a solution, but either I haven't looked long enough or it's not available.
Server.Execute
We moved an ASP application from Win 2000 server to Win 2003 server and now the Server.Execute method does not work. It gives me ASP 0228 error. What gives?
Server.execute
When we use server.execute, there are 2 pages involved, The first one is the calling page in which we call the other page and the second page is the one which is called or executed. Will the variables generated in the called or executed page be available to be used in the calling page? I tried to do this but varaibles in the calling pages are not transffered to the called page?
Server.execute
I'm trying to use server.execute statement to include in an asp page another asp page with a parameter. That's because I've a parametric query in the second asp page and I have to pass the value <% Server.Execute("result.asp?key=2") %> I can't do it. That's the error message I get: Server object, ASP 0231 (0x80004005) Invalid URL form or fully-qualified absolute URL was used. Use relative URLs Maybe the method doesn't support a parametric URL? If so, how can I do?
Server.execute
--------------------------------------------- The Execute method allows you to call another ASP page from inside an ASP page. When the called ASP page completes its tasks, you are then returned to the calling ASP page. The overall effect is very similar to a function or subroutine call. Any text or output from the called ASP page will be displayed on the calling ASP page. The Execute method is a more useful alternative to using server-side includes. In contrast, the Transfer method allows you to transfer from one ASP page to another without returning to the calling ASP page. There is one mandatory argument. --------------------------------------------- Fair enough does what I need it to. However, I've run into a glitch. I understand the point about it being like calling a sub which means anything set within the executed page will be considered local and so anything set within it won't work in the calling page. What I don't understand is why the executed page can't read objects which have been set in the calling page before the execute???
Global.asa And Server.Execute
I'm working on a web app, and I want my global.asa file to execute another file (it's a configuration file which then writes a stylesheet file), but I can only seem to get the global.asa to run once in a while. For a stretch, whenever I edited the global.asa, it would run on the next server request. I had read somewhere that the IIS process had to be restarted each time you wanted the global.asa file to execute, so when it stopped running every time I changed it I wasn't too surprised. But now, even when I restart the IIS process, the darn thing won't run! I've tried putting my server.execute statement in a regular .asp file and it creates the stylesheet file every time I run it (so I know the file I'm trying to execute runs properly). I just don't get what's going on with the unpredictability of the stinkin global.asa.
Server.Execute In Scriptlet
I have an ASP calling a scriptlet. There is a method "Exec" which is using Server.Execute to run any ASP file/command. There rest of the methods are working fine.Somehow, wscAsp.Exec("myLocalProc"), didn't work. Please help. My ASP: <% Set wscASP = CreateObject("ASPScriptlet") wscASP.sName = "sName (R/W)= OK" %> <P>The current date is <%=wscASP.GetDate()%></P> <P>The value of the Var1 is <%= wscASP.GetVar()%></P> <% Call wscAsp.Exec("myLocalProc") Sub myLocalProc response.write "Scriptlet is executing myLocalProc!" End Sub %> The Scriptlet, wscAsp.Exec method, is purely just call Server.Execute("any string passed in")
Server.Execute With Vars...
I'm trying to get a page included into another page, and so far I've been using Server.execute("home.asp") without any problems ['home.asp' is just an example], but now I' m trying to get this to work: server.execute("home.asp?foo=bar") but to no avail. Code:
|