Home All Groups Group Topic Archive Search About

How to download a file from Server to client local pc without user intervention?

Author
19 Jul 2006 3:11 AM
Ashok
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

Author
19 Jul 2006 4:48 AM
Cor Ligthert [MVP]
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
>
Author
19 Jul 2006 6:03 AM
Spam Catcher
"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
> intervention ie without the save as popup window.

Is this through a VB app or ASP.NET app?
Author
19 Jul 2006 9:37 AM
nime
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
Author
19 Jul 2006 11:42 AM
Herfried K. Wagner [MVP]
"Ashok" <mlas***@gmail.com> schrieb:
> How to download a file from server to client local pc without user
> intervention ie without the save as popup window.

'WebClient.DownloadFile'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>