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:

View Replies


ADVERTISEMENT

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.

View Replies View Related

Physical Path To Database

I am getting the following error from the following code:

Server.MapPath(), ASP 0172 (0x80004005)
The Path parameter for the MapPath method must be a virtual path. A physical path was used.

/html/objconn.asp, line 11

The code is as follows....

View Replies View Related

Web Site Physical Path

How can I get the physical path of a web site from an EXE application? The Web Site is on the same server as the application.

View Replies View Related

How To Give Physical Path

Please let me know how to avoid giving physical path & line number in the
error messages of web applications. Instead i would like to replace it with
general error message to the user.

View Replies View Related

Virtual Path And Physical Root

Is it possible to include my remote web server path eg: m:/html/root/site1
| m:/html/root/site2 etc

....in virtual includes....

Thus eliminating the need to create duplicate INC files in each sub-domain on my remote web server host domain IP. eg: http://72.3.5.6.0 (www.site1.com; www.site2.com)

I would like to be able to use a UNIVERSAL INC file in the root of my web IP for the benefit of all my sub domains.

View Replies View Related

Skip Out The Name Of The Page From The Physical PATH String ..

If the physical path of a page is : " e:facecgi_bindetails\_Nviews.asp "

and i want to remove "\_Nviews.asp" portion from this path ...means whenever the page refreshes,no matter what the name of the page is ....the last portion of the name of the page with slash must skip out from this path string .....how can i do this while using VBscript Functions.....like using Split(),RIGHT(),LEN(),LEFT()...etc..

View Replies View Related

Physical Path Of Any Page Hosted On Other Server

May i get the physical path of any page hosted on other server?

View Replies View Related

Hypertext Color

Is there a way to control the hypertext color. I noticed mine are blue when not clicked and red/purple when checked. Is there a way I can make them say white and blue?

View Replies View Related

Find Links In A Html File

I want to make an ASP page look at my index.html file, and give me a list of all the hyperlinks that are in this page. Is this possible, can anyone point me in the right direction?

View Replies View Related

How To Open A File Dialog And Get The Path Of The Selected File In ASP?

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

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

View Replies View Related

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:

View Replies View Related

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.

View Replies View Related

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:

View Replies View Related

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.

View Replies View Related

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?

View Replies View Related

Get The Current File Path

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

Convert Excel File To Css File

I want to Convert Excel Files to CSV files using ASP code CanAny body help me out in this.

View Replies View Related

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,

View Replies View Related

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 .....

View Replies View Related

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:

View Replies View Related

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.

View Replies View Related

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.

View Replies View Related

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 .

View Replies View Related

Asp Writes Csv WITHOUT Complete File Path?

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

Stripping File Path Name Before Insert Into DB

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

Convert A File From Unix To DOS

In my pages i have to read a text file which is created in Unix format through my asp code. The problem is that the readline command reads the whole file and not line by line as the file is in Unix format. Is there a way to convert it using asp code and then read it or any other solution to this problem?

As the file is created by an application not controlled by myself it is impossible to force the application developer to do this job so i have to do it during runtime. So what are your suggestions?

View Replies View Related

Convert Html File To Tab

I want to know, How to extract the content of an html file to Tab Delimited text file by ASP
(I want the code that do this)

View Replies View Related

Convert .aspx File

How can i convert .aspx file in .exe file so that it can run on any
computer.

View Replies View Related

How To Convert XML Or HTML To Pdf File ?

How to convert XML or HTML to pdf file ? Where can I find free pdf generator ?

View Replies View Related

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.

View Replies View Related

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 View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved