473,387 Members | 1,569 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,387 software developers and data experts.

Absolute path to url?

js
Hi,

I have stored the absolute file path in a grid, and want if user click it,
will redirect to the virtual path and download the file:

Dim fileName As String = articleList.DataKeys(e.Item.ItemIndex)

Response.Redirect(fileName, True)

But failed, how to recirect to the link? Thanks.


Apr 2 '06 #1
3 2154
Have you tried: Server.Transfer(fileName, True)

"js" wrote:
Hi,

I have stored the absolute file path in a grid, and want if user click it,
will redirect to the virtual path and download the file:

Dim fileName As String = articleList.DataKeys(e.Item.ItemIndex)

Response.Redirect(fileName, True)

But failed, how to recirect to the link? Thanks.


Apr 2 '06 #2
js
Thanks Steven,

I got this error:
Invalid path for child request
'C:\MyServer\Users\debug\Portals\0\Users\host\Hell o1.doc'. A virtual path is
expected.

The path is right. How to fix it?

"Steven" <St******@community.nospam> wrote in message
news:B3**********************************@microsof t.com...
Have you tried: Server.Transfer(fileName, True)

"js" wrote:
Hi,

I have stored the absolute file path in a grid, and want if user click
it,
will redirect to the virtual path and download the file:

Dim fileName As String = articleList.DataKeys(e.Item.ItemIndex)

Response.Redirect(fileName, True)

But failed, how to recirect to the link? Thanks.


Apr 2 '06 #3
re:
A virtual path is expected.
The path is right. How to fix it?
No. The path is *not* right.
Your web users will never find a path in your file system.

You need to use a virtual path which your web users can access.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"js" <js@so*****@hotmail.com> wrote in message news:uc**************@TK2MSFTNGP09.phx.gbl... Thanks Steven,

I got this error:
Invalid path for child request 'C:\MyServer\Users\debug\Portals\0\Users\host\Hell o1.doc'. A
virtual path is expected.

The path is right. How to fix it?

"Steven" <St******@community.nospam> wrote in message
news:B3**********************************@microsof t.com...
Have you tried: Server.Transfer(fileName, True)

"js" wrote:
Hi,

I have stored the absolute file path in a grid, and want if user click it,
will redirect to the virtual path and download the file:

Dim fileName As String = articleList.DataKeys(e.Item.ItemIndex)

Response.Redirect(fileName, True)

But failed, how to recirect to the link? Thanks.



Apr 3 '06 #4

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

Similar topics

4
by: Joe Cybernet | last post by:
Is there any function for combining an absolute and a relative URL to result in an absolute URL? Like if I have http://www.domain.com and "../images/1.jpeg" it will evaluate to...
3
by: Peter Taurins | last post by:
Hi there. I have an included file (header.php) that contanis a reference to a graphic. If I stay at the root level, then I can control the relative path of the image. eg. images/imagename.jpg ...
4
by: dchaffin | last post by:
I'm having a problem using file_exists with an absolute path and I can not figure out why. I tried the exact example that is on www.php.net ... <?php $filename = '/path/to/foo.txt'; if...
3
by: rajuvk | last post by:
I am setting up a website with a number of folders like: / (the document root) /user /admin/ /content in the /user folder there is a flie "userlogged.php", which I want to include in every...
9
by: Stuart | last post by:
Hi All, I got a challenge to make the same APS/Script/Html run on different web roots. I can not use relative pathing in a lot of cases. We use lots of included files so depending on where that...
4
by: Vitali Gontsharuk | last post by:
Hallo! When using the XPATH document() function to load a new XML document, we are coming across problems, because XALAN seems to have problems with absolute paths. XALAN always assumes that the...
7
by: Rizaan Jappie | last post by:
is it possible to get the relative path based on a absolute path in c#? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
3
by: JeffDotNet | last post by:
I wrote a small data processing application that writes a summary of several hundred files. I use drag and drop on a panel (Panel1) to grab the absolute path to each of these files. Then I begin...
19
by: Jerry M. Gartner | last post by:
Greetings: What is the best way to resolve paths within a document regardless of what path it is opened under? For example: I have x.php and it contains <img src="images...">, (amongst other...
6
by: Jon Slaughter | last post by:
do I have to prefix every absolute path with document root to get it to work? For some reason I thought that prefixing a path with '/' or './' with make it absolute w.r.t to document root but I...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.