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 Replies
ADVERTISEMENT
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.
View Replies
View Related
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
View Replies
View Related
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">
View Replies
View Related
I'm programming in the file
<web root>myappmypage.asp
How would I print out "myapp" without hard-coding the value of "myapp"?
View Replies
View Related
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?
View Replies
View Related
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.
View Replies
View Related
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/"
View Replies
View Related
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.
View Replies
View Related
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:
View Replies
View Related
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
View Replies
View Related
i am having a problem in how to create a Open File dialog to enable user to select a image file that will be stored into database. i just want the file path to be stored in database, not the image.
View Replies
View Related
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
View Replies
View Related
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?
View Replies
View Related
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?
View Replies
View Related
May i get the physical path of any page hosted on other server?
View Replies
View Related
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:
View Replies
View Related
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.
View Replies
View Related
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:
View Replies
View Related
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.
View Replies
View Related
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?
View Replies
View Related
In my ASP file, located at the "/test" directory of the website, I include another ASP file as below.
<!--#include file="../templates/_header.asp"-->
Inside the _header.asp file, how can I get the current file (_header.asp) directory? I need to get the web relative/absolute directory of _header.asp, but instead even if I can get the physical directory location of that file should be fine.
I tried Request.ServerVariables("") with almost all the variables, but none gave me what I wanted. This is necessory, becase the location of _header.asp and the file which includes that can vary.
View Replies
View Related
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,
View Replies
View Related
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 .....
View Replies
View Related
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:
View Replies
View Related
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.
View Replies
View Related
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.
View Replies
View Related
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 .
View Replies
View Related
I have a simple asp form which writes to a csv.
The code it's based on (from "ASP for Dummies") is:
Set peoplefile - _
filesys.OpenTextFile( _
"c:inetpubwwwrootgbgbpeople.txt",1)
The form is going live soon, and I'd like just a dash of due diligence
in terms of security. I tried using a relative link to the gbpeople.txt
file which didn't work. Is there a better way around this without
reinventing?
View Replies
View Related
Does anyone know of a function that will take the file pathname and just keep the file name before doing an insert into a database? Code:
View Replies
View Related
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.
View Replies
View Related
I have an upload script but i would like to show the person who uploaded the file the path to the file he uploaded. Ex: http://site.com/images/uploadedfile.jpg.
View Replies
View Related
ive got a bit of code to check if a file exists and it works if I use the full path ie "C:Inetpubwwwrootfile.txt" can someone advise me how to get it so I can use the relative path ie "file.txt" where the file and the code are in the same directory? Code:
View Replies
View Related