Error using MapPath 'http: / .. is not a valid virtual path.'

1

I'm trying to open a file on page_load through a ReturnCam () function that returns the URL of the file.

reEditorContrato.Open(MapPath(RetornaCaminho(CodigoArquivo)))

obs: reEditorContract is an ASPxRichEdit control from DevExpress

The function returns me the string " link ", but the moment it opens through MapPath it returns an error.

'http: / localhost: 51696 / example / contracts / Contract.docx' is not a valid virtual path.

I noticed that in that part http: / he pulls out a slash and I believe it is for that reason that the path is always invalid.

Any solution?

    
asked by anonymous 24.03.2015 / 16:09

1 answer

0

Well, as you can see this link , the MapPath method only accepts physical paths from the server (such as the virtual path in the error message) . In this case, I believe you would have to pass your way this way to the function: "/ example / contracts / Contract.docx" , ie without the < it would explain the treatment it does by removing one of the http: // > .

I hope I have helped.

Any questions are available!

    
27.09.2016 / 01:21