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.
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(Ser ver.MapPat h("~/Downl oadServer/ "), fuSheet.FileName)
fuSheet.PostedFile.SaveAs( filenamepa th)
I have taken few screenshots. Please take a look.
InkedIMG_20200220_115302244_LI.jpg
IMG_20200220_115022854.jpg
IMG_20200220_115210358.jpg
Dim filenamepath As String = System.IO.Path.Combine(Ser
fuSheet.PostedFile.SaveAs(
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"
in your web.config?
ASKER
I tried below code
If fuSheet.HasFile Then
Dim filenamepath As String = System.IO.Path.Combine("\\ 192.168.3. 31`\Sudhan shu\Downlo ad\", fuSheet.FileName)
fuSheet.SaveAs(filenamepat h)
Path = UploadPath
End If
Error i got is
fileUpload.Error:The filename, directory name, or volume label syntax is incorrect.
If fuSheet.HasFile Then
Dim filenamepath As String = System.IO.Path.Combine("\\
fuSheet.SaveAs(filenamepat
Path = UploadPath
End If
Error i got is
fileUpload.Error:The filename, directory name, or volume label syntax is incorrect.
ASKER
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
ASKER
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.
ASKER
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 TRIALMembers 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.
How are you uploading the file? Also please post some screenshots of the virtual directory configuration