Failed to map the path '/192.168.1.xxx/upload/filename.txt'http://forums.asp.net/t/1802532.aspx/1?Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Fri, 11 May 2012 01:32:26 -040018025324975455http://forums.asp.net/p/1802532/4975455.aspx/1?Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>im trying to upload a file to a network shared folder. Everyway that i try bring the same error except when i try to map the drive fist and then use the letter then i get can not use pysical drive on virtual folder, somthing like that.</p> <p>here is the code im using.</p> <pre class="prettyprint">Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) If FileUpload1.HasFile Then Dim FileName As String = Path.GetFileName(FileUpload1.PostedFile.FileName) Dim Extension As String = Path.GetExtension(FileUpload1.PostedFile.FileName) Dim FolderPath As String = &quot;\\192.168.1.200\backup\&quot; Dim FilePath As String = Server.MapPath(FolderPath &#43; FileName) FileUpload1.SaveAs(FilePath) GetExcelSheets(FilePath, Extension, &quot;Yes&quot;) End If End Sub</pre> <p>i have check permission to write everyone has full control - i will appreacite any idea thank you</p> 2012-05-10T22:42:35-04:004975471http://forums.asp.net/p/1802532/4975471.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>That's correct, you have to map the drive to do it this way. You cannot use an IP address, only a drive or share that is visible to the computer.</p> 2012-05-10T23:23:06-04:004975477http://forums.asp.net/p/1802532/4975477.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>Also you shouldn't use the Server.MapPath which is used to map paths that are relative to the website, which is not the case here</p> 2012-05-10T23:35:42-04:004975496http://forums.asp.net/p/1802532/4975496.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>so what should i use ?</p> 2012-05-11T00:13:15-04:004975502http://forums.asp.net/p/1802532/4975502.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>If you have the full path you don't need anything. You could use System.IO.Path.Combine(foldername, filename) to merge those two parts, but otherwise you should have the full path</p> 2012-05-11T00:16:43-04:004975508http://forums.asp.net/p/1802532/4975508.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p></p> <blockquote><span class="icon-blockquote"></span> <h4>markfitzme</h4> <p></p> <p>That's correct, you have to map the drive to do it this way. You cannot use an IP address, only a drive or share that is visible to the computer.</p> <p></p> </blockquote> <p></p> <p>I change the ip address to the server name but still the same issue Failed to map the path.</p> <p>/servername/upload/filename.txt</p> 2012-05-11T00:25:00-04:004975513http://forums.asp.net/p/1802532/4975513.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p></p> <blockquote><span class="icon-blockquote"></span> <h4>dahla</h4> <p></p> <p>If you have the full path you don't need anything. You could use System.IO.Path.Combine(foldername, filename) to merge those two parts, but otherwise you should have the full path</p> <p></p> </blockquote> <p></p> <p>&nbsp;</p> <p>i use the path latter on in my code, to load the file again? whould it matter?</p> 2012-05-11T00:27:45-04:004975515http://forums.asp.net/p/1802532/4975515.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>You are getting the error in the server.mappath line and not in the saveas line, correct?</p> <p></p> <p>Markfitzme is probably refering to drivemapping and not server.mappath</p> 2012-05-11T00:28:24-04:004975516http://forums.asp.net/p/1802532/4975516.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p></p> <blockquote><span class="icon-blockquote"></span> <h4>eli2011</h4> i use the path latter on in my code, to load the file again? whould it matter?</blockquote> <p></p> <p></p> <p>No the fil will still be located at the same path</p> 2012-05-11T00:29:03-04:004975519http://forums.asp.net/p/1802532/4975519.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>Still can't be the server name, has to be a mapped folder or share. The reason is this only works through the file system is that it is not the type of function that works over the network, file system only. Typing in the IP address or server name still is a network connection and uses network protocols. Not what this can do, only files that are local, or perceived to be local. Attaching a networked drive or share means that the OS does the work, and makes it transparent to the regular File I/O routines so that they think it's local storage.</p> <p>There are lots of reasons why you cannot put in the servername/ip address. Mostly dealing with security. You would need some other application on the other server to listen for connections that are transmitting files. It could be another web server that has a page or web service that you can post files to and it will handle storing them on that server since to it, the locations are local. So in a nutshell, you either have to map the storage or find another, and more complicated and potentially less secure way of saving files to other servers on the network.</p> 2012-05-11T00:31:37-04:004975527http://forums.asp.net/p/1802532/4975527.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p>yes the err is on the server.mappath</p> 2012-05-11T00:56:43-04:004975529http://forums.asp.net/p/1802532/4975529.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <p></p> <blockquote><span class="icon-blockquote"></span> <h4>dahla</h4> <p></p> <p>You are getting the error in the server.mappath line and not in the saveas line, correct?</p> <p></p> <p>Markfitzme is probably refering to drivemapping and not server.mappath</p> <p></p> </blockquote> <p></p> <p>&nbsp;</p> <p>Can i do ip address in the saveas line ???</p> 2012-05-11T00:59:00-04:004975551http://forums.asp.net/p/1802532/4975551.aspx/1?Re+Failed+to+map+the+path+192+168+1+xxx+upload+filename+txt+Re: Failed to map the path '/192.168.1.xxx/upload/filename.txt' <pre class="prettyprint">FileUpload1.SaveAs(FilePath) FileUpload1.SaveAs(&quot;\\192.168.1.240\backup\&quot; &#43; FileName)</pre> <p>This way I load it first to local IIS folder and then load it to my other server. that way i can process it on the IIS and on my SQL server. Thank you everyone for the ideas.</p> 2012-05-11T01:32:26-04:00