user1150440
user1150440

Reputation: 449

how to get the remote url

I am using

Dim url As String = Server.MapPath("MyFiles") & "\" & System.IO.Path.GetFileName(hpf.FileName)

to get the url of the uploaded file.

The result i get is

D:\2008VS\LTC INDIA\LTCIndia v 1.52\AdminPanel\MyFiles\1.jpg

i want it to be like this http://www.abcd.com/AdminPanel/MyFiles/1.jpg

Kindly let me know if posting the whole code would be of any help.

Upvotes: 0

Views: 132

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038850

You could use the ResolveUrl method:

Dim url As String = ResolveUrl("~/MyFiles/" & System.IO.Path.GetFileName(hpf.FileName))

Upvotes: 4

Related Questions