Link to home
Start Free TrialLog in
Avatar of Sudhanshum
Sudhanshum

asked on

Virtual Directory not seems to work on IIS website Asp.net

I was using Virtual directory on IIS website, But I dont understand its significance , I have set Virtual director as another server IP for eg \\192.168.2.2\Download and I wanted to upload my file on Virtual director so its automatically get copied to \\192.168.2.2\Download location but it seems to upload on same server where IIS website is set,  Please let me know if anyone has idea on that.
Avatar of Ajay Menon
Ajay Menon
Flag of India image

How are you uploading the file? Also please post some screenshots of the virtual directory configuration

Avatar of Sudhanshum
Sudhanshum

ASKER

I have setup DownloadServer as Virtual Directory on my website IIS , Here is code I used
Dim filenamepath As String = System.IO.Path.Combine(Server.MapPath("~/DownloadServer/"), fuSheet.FileName)
fuSheet.PostedFile.SaveAs(filenamepath)

I have taken few screenshots. Please take a look.
InkedIMG_20200220_115302244_LI.jpg
IMG_20200220_115022854.jpg
IMG_20200220_115210358.jpg

Not proficient in VB but how about something like:

Dim filenamepath As String =  System.IO.Path.Combine("\\192.168.3.31`\Sudhanshu\Download\", fuSheet.FileName)


Also, have you tried using

identity impersonate="true"

Open in new window

 in your web.config?


I tried below code
If fuSheet.HasFile Then
Dim filenamepath As String =   System.IO.Path.Combine("\\192.168.3.31`\Sudhanshu\Download\", fuSheet.FileName)    
                fuSheet.SaveAs(filenamepath)
                Path = UploadPath

            End If

Error i got is
fileUpload.Error:The filename, directory name, or volume label syntax is incorrect.
My main moto is to get file upload and download on different server

Computer with the ip of 192.168.3.31`

has to have a share 'Sudhanshu' with share permissions of everyone full

and the folder 'Download' should have the permissions of read/write/modify but not execute set to everyone

if my path is just \\192.168.3.31`\Sudhanshu then what access I need to give? Also is Virtual Directory allow to update on mapped network?

On your remote file system, ensure your application pool account RW has access to it.

Can u plz provide me running code which will work with  Virtual Directory? Also Virtual Directory allow to upload on network path?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.