|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to download a file from Server to client local pc without user intervention?Dear Friends,
How to download a file from server to client local pc without user intervention ie without the save as popup window. Can you give me step by step. Thanks Ashok,
That should be normally prevented by the securitiy options. It should be impossible without any user intervention, if that user has not loaded any special software from you that makes that possible (what is of course an action). I hope that this gives an idea, Cor Show quoteHide quote "Ashok" <mlas***@gmail.com> schreef in bericht news:1153278703.862556.155520@m79g2000cwm.googlegroups.com... > Dear Friends, > > How to download a file from server to client local pc without user > intervention ie without the save as popup window. > > Can you give me step by step. > > Thanks > "Ashok" <mlas***@gmail.com> wrote in news:1153278703.862556.155520 @m79g2000cwm.googlegroups.com:> How to download a file from server to client local pc without user Is this through a VB app or ASP.NET app?> intervention ie without the save as popup window. With VB.NET, I use two methods: You may use ftp connection or internal My.Computer.Network.UploadFile/DownloadFile commands...
Public Sub Upload() ''Upload file 'Dim ftp As FtpWebRequest 'ftp = FtpWebRequest.Create(Url & "/" & ReportFile) 'ftp.Method = WebRequestMethods.Ftp.UploadFile 'Dim sourceStream As New StreamReader(Application.StartupPath & "\" & ReportFile) 'Dim fileContent As String = sourceStream.ReadToEnd() 'sourceStream.Close() 'ftp.ContentLength = fileContent.Length 'Dim fileBytes() As Byte 'Dim encoding As New System.Text.ASCIIEncoding() 'fileBytes = encoding.GetBytes(fileContent) 'ftp.Credentials = New NetworkCredential(login, pass) 'Dim requestStream As Stream = ftp.GetRequestStream() 'requestStream.Write(fileBytes, 0, fileContent.Length) 'requestStream.Close() 'Dim response As FtpWebResponse = ftp.GetResponse() 'Console.WriteLine("Upload status: {0}", response.StatusDescription) 'response.Close() ''Delete file 'Dim ftp As FtpWebRequest = WebRequest.Create(Url & "/" & UserFile) 'ftp.Method = WebRequestMethods.Ftp.DeleteFile 'ftp.Credentials = New NetworkCredential(Login, Pass) 'Dim response As FtpWebResponse 'Try ' response = ftp.GetResponse ' Console.WriteLine("Delete status: {0}", response.StatusDescription) ' response.Close() 'Catch ex As Exception ' 'Console.WriteLine("Delete status: {0}", response.StatusDescription) 'End Try 'Exit Sub Dim _Updated As Boolean = True Try 'Url = "http://ftp.domain.com/folder/" My.Computer.Network.UploadFile(Application.StartupPath & "\" & UserFile, Url & "/" & UserFile, Login, Pass, False, 30 * 1000, FileIO.UICancelOption.DoNothing) Catch ex As Exception _Updated = False Debug.Print("UPLOAD USERFILE FAIL: " & UserFile) End Try End Sub "Ashok" <mlas***@gmail.com> schrieb: 'WebClient.DownloadFile'.> How to download a file from server to client local pc without user > intervention ie without the save as popup window. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
HELP! Why is SqlException being caught in this code if it can't connect to SQL Server?
Public Shared Property Barcode scanning Display Unicode characters on Winforms concurrency question Refreshing datagridview after a rowtemplate height change ADO.NET in VB6 String comparison algorithms ByRef - delayed update of the original variable? The RPC Server is unavailable! |
|||||||||||||||||||||||