Not a valid virtual path
-
Got an error when i deployed not a valid virtual path. though i have added permissions to image folder on the server. Iam using a function that returns save location and uploads the image. this is the code iam using:
Private Function Uploaded() As String
Dim filePath As String = AppSettings("~\Images")
Dim SaveLocation As String = String.Empty
If Not txtImgURL.Text.Length = 0 And Left(txtImgURL.Text, filePath.Length) <> filePath Then
Dim fileName As String = System.IO.Path.GetFileNameWithoutExtension(txtImgURL.Text).ToLower()
Dim fileExtention As String = System.IO.Path.GetExtension(txtImgURL.Text).ToLower()
SaveLocation = System.IO.Path.Combine(filePath, fileName & fileExtention)
Dim physicalLocation As String = Server.MapPath(SaveLocation)If File.Exists(physicalLocation) = True Then Dim sequencer As Integer = 1 SaveLocation = System.IO.Path.Combine(filePath, fileName & "\_" & sequencer.ToString & fileExtention) physicalLocation = Server.MapPath(SaveLocation) Try My.Computer.FileSystem.CopyFile(txtImgURL.Text, physicalLocation) Catch My.Computer.FileSystem.CopyFile(Server.MapPath(txtImgURL.Text), physicalLocation) End Try Else Try My.Computer.FileSystem.CopyFile(txtImgURL.Text, physicalLocation) Catch My.Computer.FileSystem.CopyFile(Server.MapPath(txtImgURL.Text), physicalLocation) End Try End If End If Return SaveLocation End Function
Any help?
to which user you added the rights?
In Word you can only store 2 bytes. That is why I use Writer.
-
to which user you added the rights?
In Word you can only store 2 bytes. That is why I use Writer.
-
i have added on folder images, the strange thing happening is that i can update an image already found but cant add a new image.
which user and which rigths are added to the directory?
In Word you can only store 2 bytes. That is why I use Writer.
-
which user and which rigths are added to the directory?
In Word you can only store 2 bytes. That is why I use Writer.
-
I have added to the directory aspnet user with full control and network service with full control.
that should be sufficient. The folder one level higher has both users with the rights? (back up to the root?)
In Word you can only store 2 bytes. That is why I use Writer.
-
I have added to the directory aspnet user with full control and network service with full control.
is this folder somewhere within the wwwroot or have you placed outside wwwroot folder
In Word you can only store 2 bytes. That is why I use Writer.
-
is this folder somewhere within the wwwroot or have you placed outside wwwroot folder
In Word you can only store 2 bytes. That is why I use Writer.
-
has wwwroot full control for asp_net user and network_Service ?
In Word you can only store 2 bytes. That is why I use Writer.
-
has wwwroot full control for asp_net user and network_Service ?
In Word you can only store 2 bytes. That is why I use Writer.
-
well, that makes it a curious case. I believe that if you pick Full Control you could still set some other options if you pick the Edit button.
In Word you can only store 2 bytes. That is why I use Writer.