Map path of another Project

Asked

Viewed 405 times

0

I have a WEB solution ASP, and I have 4 projects in the solution. I have to map the path of a folder (Imagery) that is in a project called ADMIN. And from my WEB project I have to save the images inside this same folder.

my directory code is like this...

diretorio = Server.MapPath("~/Imagens/"); // mas ele da erro diz que o caminho virtual nao pode ser encontrado...

Then I picked it up and put it all the way up...

diretorio = Server.MapPath("~/siteWEB/siteADMIN/Imagens/"); // que seria o caminho todo mas ele da o mesmo erro, que o caminho nao pode ser encontrado.

How to Save Images in Different Projects?

  • Welcome to the Sopt. Just to help you get used to our philosophy, which is different from a forum, take a look at http://answall.com/help/behavior, especially the 3rd. item. If not read yet, it would be good to take a look at [about], you win a medal. You can use [Edit] to leave your question in the way of a straight and clean question. Gradually you get used to it.

2 answers

1

It is important to remember that the path should be the physical directory on the server as for example:

Server.MapPath("C:\Inetpub\wwroot\SeuProjeto\Imagens")

Also remembering that ASP 3.0 does not accept ; at the end of the lines/commands.

  • this wrong the answer, the Mappath Server.Mappath is precisely to translate the relative path (../images) in c: Inetpub etc

0

That images folder is in which location before your Asp code ?

ex:

root/
    /arquivo.asp
    /Imagens/

if that’s the case, just

diretorio = Server.MapPath("Imagens/")

now if you were like this:

root/
    /etc/
    /etc/arquivo.asp
    /imagens/

diretorio = Server.MapPath("../Imagens/")

I don’t remember anymore, but I think ASP has no way to get back all the folders, try:

diretorio = Server.MapPath("\Imagens")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.