Finding Absolute File Path On Server?
I am trying to create a log of certain events on the website by writing them to a text file. The logging code is in an "included" file that is inserted into the pages that need to be monitored. Currently, the target text file is just specified in the FSO MapPath as "thelog.txt", so it writes the log to a text file within the same folder as the web page.
The problem is that I don't want to grant browsers Write access to my pages folder, so I need to have a separate directory to hold the log text file that browsers can have Write access to. The web site is hosted on a shared server that I do not have direct access to. In the past, occasionally an error has popped up that states the exact location, but I can not get that to repeat. I know it is something like "D:customersmyuseridwww"
How can I find out the actual location on the server so I can use an absolute path to write all the logs to one file in one location?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Finding Absolute Path To Script On Linux System
i need to find the absolute path to a folder (/home/httpd/ etc....) on a linux system. is ther a script that i can uses that will tell me the absolute path to it. then i can chnge to to the folder.
Absolute Path
Why it is that to saVE a file an absolute path is required and to read a file or pic an relative path is required.can any one ellaborate it and also diff between relative and absolute path
Use An Absolute Path
What are the pro's and con's of both methods? Should I use: <img src="../images/new_images/spacer_tenpix.gif" width="10" height="10"> or <img src="http://www.keomed.com/images/new_images/spacer_tenpix.gif" width="10" height="10">
Absolute/Virtual Path For Images
I have a web project that has multiple directories. Some of the files in different directories use the same include files. The problem is that these include files also reference an image folder. I am trying to create an absolute reference to these images so I don't have to make the same include for different directories. What is the best way to do this?
Finding A Path
Is there something similar to PHP's php_info command to tell me all about the server? I need to find the actual path where the site resides.
Finding Out The Path Of Current Page
Is there an easy way to find out the path of the current asp page? When looking at http://localhost/images/listing.asp I want to be able to extract "http://localhost/"
Need To Load File Path From Web Server Into Text Form Box
I need to load the file path of a file on a web server into a form text box. I tried using a normal form box using type=file but that just seems to return the file path from the local machine. Ideally I'd like it if someone can get this to work with a file on a web server without using asp. If not then I suppose I'd have to use the FileSystemObject method. I can see how you can get a list of files from a remote server using FileSystemObject. The problem I need help with is selecting a file path from the list of files into a text form box. The path of which I am then going to write to a database field.
ASP Not Finding File That Do Exist!
I'm using vbscript in ASP to loop through and rename the files passed to it in a form. When I output the text to the screen of the filenames etc it's all working fine. However, when I try to get the rename code working, if I select more than one, ASP tells me the 2nd/3rd etc file does not exist. The first one always renames ok. I presume this is something to do with the Server.MapPath, but what exactly I have no idea! My code is below, can anyone see what I'm doing wrong? Code:
Function For Finding File Name
i have a person upload a file, that is done, then i want to email the file. I know the location, but not the file name. How do i find the file name to attach to the location addy? example: objEmail.AttachFile("d:greguploads" & filename & """) , "SNAIL_File" , 1
Store File Path And File Name Seperately
if i got a file path as a variable say for Example: c:folder1folder2folder3folder4file.txt (The Path could be any long) how do i just store the Path of the file name and the file name seperately. like : File Path=c:folder1folder2folder3folder4 File Name=file.txt
Server.Transfer And Image Path
I have a subdirectory with it's own images folder. All the image paths in the pages in the sub directory are "image/image.jpg" When I Response.Redirect to a page in the subdirectory the images are fine but when I use Server.Transfer all the links are broken. I'd prefer to use the relative paths. Is there a way around this in the Server.Transfer?
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?
File Path Show
I have a problem. I tried my best but could not solve is. I have a page where user selects the folder name from a drop down list. It takes user to show.asp page, where it how all the files in the folder and also user can click on them and download them. If I select name of the folder from the list, on show.asp it shows all the files and their link. When I click on the link then most of the file which has long name and have space in their names wont be hyper linked. For example if files name is Virus Control.vsd or file name is INCIDENT-ACCIDENT INVESTIGATION REPORT.htm. If I click on them it will say "The page cannot be found". Code:
Dynamic File Path
I have setup a site that allows users to login with a username and a password that are stored in a mysql database, now what i need to do is set it up so the users can only download specific file(s) related to their username. With my current set up using all asp and iis 5.0 all the users can download the same file from a certain directory. I was thinking of somehow using the session variable of the username as a variable in the download path of the file, but i don't know if this is a correct method of doing this or the correct syntax.
Get File Path From Refereing URL
This does not seam to work for me in IE, but does in Netscape? What I am trying to accomplish is this. On the footer of everypage we have a link that opens a comment page, example [<a href="#" onclick="javascript:view_win(/comment/comments2.asp');" class="notes">Send Comments</a>]. I am trying to write asp code to that takes the referering page and then gives the the filepath of that page which searches a database of web authors, and then returns the authors email address. after that I loop to add input sendto's for each one found. Code:
How To Split Path And Get File Name
i want to trim the given path and get the file name with its extenstion: i.e. only get the "XPIcon.jpg" in the following example URLImage = "D:Documents and SettingsAdministratorDesktopXPIcon.jpg" Note: the URLImage is always chaning, its not constant.
Parsing File Path
I'm needing some help on this. I need to know how to parse a file path for the file name in a browse box. Lets say I have a browse box in a form with the input of C:/somedirectory/somefile.asp I need a piece of code that could convert the input into just somefile.asp?
Uploading File W/ Dynamic Path
I am attempting to upload files to a folder on a remote server. However the folder is different for each user based on login. Is there anyway to do this using the code below. If not can someone tel me of a way to do it. Dim DestinationPath DestinationPath = Server.mapPath("UploadFolder") what I'm doing is executing a query based on login for a varible called "uploadFolder", so I want my destination path to be something like <% DestinationPath = Server.mapPath("rsRecord(uploadFolder)")%> Of course my code doesn't work,
Upload :: Save The File Path
I am not able to save the file path into database remaining everything is working good i can upload the image to the folder and save the data to the database. I am using MySQL database .....
Determine Whether A Path Is A Directory Or A File
does any one here know of a good way to to determine whether or not a given path is a directory (e.g., "c:mydir") or a file (e.g., "c:mydir myfile.txt")? i started attacking this problem by using filesystemobject to check whether or not a directory existed for the path. if so, it was a directory path. if not, i checked to see if a file existed for it. if so, it was a file path. Code:
Passing File Upload Path
The file uploader code I've been using won't let me use Request.Form and BinaryRead on the same page so I've resorted to having the file upload code on another, seperate page that is spawned from the first. Trouble is, the path to store the file at is determined on the first page and I don't know how to pass it along to the second.
Access File Path Question
I usually use SQL Server, but have occasionally had to use Access. This is such an occasion. My research, mainly at aspfaq.com, has been that you need to put the file path in your connection string, like this (watch out for the wrap): strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:mydirectorynamedbname.mdb;User Id=xxxxx;Password=xxxxxxx;" Well, the host of this new site I am working on is asking me if a relative path will work. I don't think it will, but thought I should ask.
Path/File Access Error
I have one COM (.dll) for uploading files to server. Its working fine on server A but same code and file not working on server B giving error Path/File access error .
File Path Of Currently Executing Script/Page
Is there a way to determine the filepath of an ASP script being executed, like so? First file contains: <% For Each x In arrNuggets Server.Execute "/nuggets/" & x & "/default.asp" Next %> The executed file, default.asp, needs to be able to figure out what it's parent folder name is. Request.ServerVariables("SCRIPT_NAME") only returns the name of the first initial page loaded, and nothing about the page currently being executed.
Convert A Physical File Path To A URL For Hypertext Links
I have a Physical path that I need to convert on the FLY I thought using Replace would be a good idea, and it almost works function MapURL(path) dim url2 'Convert a physical file path to a URL for hypertext links. url2 = (path) MapURL = Replace(url2, "", "/") MapURL = Replace (url2,"E:","http://myscs/docLibraryDocs") MapURL = Replace (url2, "IntranetLibrary", "") end function %> - Is it possible to have multiple replace on the same variable ? - am I doing it the right way ? or is it possible to concatenate those replace in one go ? Is there a limit on how many Replace one can use for one variable ? The problem I have is that it takes the first two Replace in consideration but not the third one. If I remove or comment the second one then the First and the third one works fine. For some reason, it doesn't like to have the three in the same time. by the way, the link I try to change is as follow: Code:
Using Position: Absolute.
I am using position feature for images...although its placing the image on the HTML file using the top left corner of the image. Anybody know how to make it use the center of the image? <img src="image.gif" style="position: absolute; left: 54; top: 34">
File System Object Doesn't Work In Virtual Path?
I have a virtual path setup in order to give my web server access to a file on my app server. I am using the file system object to check for the existance of the file and if it exists, it has to validate the file date. The problem is I can't seem to find the file. I can successfully check for the existance of a file on the web server, but once I enter the virtual path it can't find anything. All three of these calls return false... fso.FileExists("http://server/localfolder/virtualfolder/test.txt") fso.FileExists("/localfolder/virtualfolder/test.txt") fso.FileExists(Server.MapPath("/localfolder/virtualfolder/test.txt")) However these two calls work, so I assume I am referencing the file correctly... Response.Redirect "http://server/localfolder/virtualfolder/test.txt" Response.Redirect "/localfolder/virtualfolder/test.txt" Am I doing something wrong here? The virtual path is setup with an id that has full access to the folder.
Uploading Files Absolute & Relative Paths
I got a problem when I uploaded a file with the input tag of type file "<input type=file.." using the FileSystemObject where The page not opens and there is no any respond, but I tried to see if the folder that is already exists xan I see by that object I discovered that it is not exist. The main problem I put my files in a folder that I dont know its absolute path , just a relative that always not exist.
Physical Path & Virtual Path
I have problem with physical path & virtual path on the server. <!--#include virtual="country/inc.bottom.asp"--> In this script it is working. In all the file i have <!--#include file="../ar-inc.top.asp"--> this script. I have about 10,000 files in the website.
Post File From Server To Another Server
I accept a few user inputs and a file from the user, post it to my ASP page. I'm able to receive the data as well as the file properly in Receiver.asp. In my receiver.asp, I need to process the user inputs and subsequently POST this data and the file again to a different server. I would like to use ServerXMLHttp. Now, how do I simulate Form creation in receiver.asp. I use the following code to post to the second server MyXmlHttp.open "post", myTargetURL,false MyXmlHttp.setRequestHeader "Content-Type", "multipart/form-data" Now here's where I get stuck. 1) How do I construct the form data? How can I put together the data i received (which is text) as well as the received file (which is Binary) in the same Send statement for the Post? -- I assume that if HTML forms do it in some format, I should be able to simulate the same through ASP, but how??? 2) The received file will not be stored anywhere in my server. It has to be forwarded in memory. Should it look somewhat like the following? MyXmlHttp.send ("userId=" & someUserId & "&privateLabelID=" & someLabel & "&File=" & receivedBinaryFileInMemory)
Finding Age
I have a database with date of births stored dd/mm/yyyy (english dating system) and =date() returns a date in the same format in my server. how do i find the persons age using these two pieces of date.
Finding Word
i want to make a program to find out and highlight a particular word on the browser using ASP and javascript.
Finding The Webserver Name
I need to create a new application in our test server. I am using VID for that purpose. In order to set up the project in VID, it asks me 'which server you want to use'. However, I do not have the name of the test server. Is there any way to configure the name of the server here? I have full rights to the server directory and is mapped on my machine as G drive.
Here Is A Function For Finding Age
Here is a function where you don't have to worry about the leap year. You will have to still be aware of time differences between you and the server, and correct your data before entering it into the function. And of course time zones, yada yada .... BUT I think that most people using this will just want to say if today is there bday than they are their new age. Code:
Finding Version
How can I programatically ascertain what version of ASP my ISP has installed ?
Percentages Finding Of
I need help to find percentages, because I missed out on a lot of basic math education, I need it to be real clear step by step instruction for instance how would I go about finding 24 out of 32 one step at a time?
Finding A Port
i know how to find the available server names, how can i find the ports?
Finding A Hotel
I am developing a hotel finder solution in Canada. When some one enters a Postal code, it should be able to display the hotels in 5 KM radius. (With nearer PIN numbers?) I am deleloping this application using ASP, and is there anyway I can such searches?
Finding The Space
I trying to find the memory occupied by the object in RAM, For Example: Set ObjTest = Server.CreateObject("ADODB.RecordSet") I need the space occupied by the ObjTest in RAM. Is it possible ?
Finding Element In Array
I'm creating an array from the querystring, then I want to find if something is in that array.. url = quiz.asp?done=6|3|4 done = Request.QueryString("done") myArray = Split(done,"|") For Each i In myArray If myArray(i) = x Then do something End If Next I keep getting a "subscript out of range error"
Finding Out The Number Of Requests
I have a form. When I do action="POST" I can see the changes done by looking at ---- for example request("MyBox") Where MyBox is a dropdown box and by doing request("MyBox") I get the selected value. Is there a way I can get the number of requests done? (i.e if I had 3 dropdown boxes then I get 3). Also is there a way to get a list of the names of all the requests (i.e if I had 3 dropdown boxes then I get MyBox1 MyBox2 MyBox3)
Finding Newest Record
I have a section of code that is supposed to search through a DB comparing a field of when the record was added. Its supposed to find the latest record and move to that record so it can process some other code:
Finding And Renaming Image.
Heres what im trying to do, I have mssql databse full of about 15,000 item ID codes. For Example of the ID Code: The first 2 sometimes 4 letters represents the distributor name, the numbers are the item number and BX for example means Box. DJ3726 DJ3847BX DJ3743CD PD2374 PD2334 PD4334BX And I have about 15,000 images from my distributrs that mostly match up to the actual ID number, but still a lot dont match up because of a small extra letter like BX Or somehting like that. So what ive done was write a code that Splits out the Manufature code for example DJ from DJ3726BX, and also the same for the item ID 3726 from DJ3726BX, So when I put thos to together I get just the manufature name and ID code instead of the extra crap I dont need. And now I take just the Manufacutre name and ID and looping through my database and all of the (images via File Scripting Object). Then I check to see if the manufacure code and ID is in the item name. For Example Check if DJ74637 IS In: DJ74637BX.GIF Then if it finds a match it gos and renames the gif for me. And it loops through untill its done. My problem is that it just doesnt work, no errors no anything it just doesnt pick up any images when I can visualy go through my self and find some matchs. Heres my code that I came up with so far ....
Finding Current Directory?
How can I find out the full directory path (i.e. c:path ofile) of a file? I'm logged into a server and the of course, I have an FTP directory root, but I need to know the absolute path.
Problem Finding ID In Database
I have this page that gets a list of catagories from the database and displays them with there id numbers in a select box like this <select name="catagories"> <option value="1">Catagory 1</option> <option value="2">Catagory 2</option> </select> Then I post it to another page to process the information. This is written in asp and vbscript. I open a dsnless adodb connection to the database then use it to create a recordset for the catagories table. the problem is when I check the idnumbers in the database with the one posted selected by the user in the previous page none of them match. Code:
Finding Directory Level
I am using Request.ServerVariables("SCRIPT_NAME") to get the extention from the url and need to know if I am in the root or down a directory. i have two folders, one called 'local' and one called 'group'
|