Login  
Search All Forums
Dart Home | PowerTCP Server for ActiveX | Custom Development Reply | PowerTCP Server for ActiveX Topics | Forums   
AuthorForum: PowerTCP Server for ActiveX
Topic: Change the file send by the FTP server
Wim

From: Alphen aan den Rijn, Netherlands
Posts: 23
Member Since: 06/22/05
posted September 22, 2008 6:35 PM

When a client requests to download a file, the server will generate an event telling the application that a file is going to be downloaded. You can get the name of the requested file. Can you change that name and will the new file get downloaded by the client? The problem is that a client can request to download a certain file (multimedia content) but when that file has been replaced by another one the server should send hem the new file. e.g the client requests 1234.jpg but that file has been replaced by 1234a.jpg, the server should give the client the 1234a.jpg file.
If this works you can also send a 'dummy name' and the server can then decide which file to send to the client.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted September 23, 2008 9:48 AM

Hi,
Yes, you can do this.
In the example below, if a certain file is requested, data from a different file is sent.
Hope it helps,
-ken

If Request.Completed = False Then
  If Request.Parameters(1) = "file.txt" Then
    Request.Parameters.Clear
    Response.Status = 150
    Response.StatusText = "Sending data from a different file"

    Dim ds As New DartStream
    ds.FileName = App.Path & "\substitute.txt"
    Response.data = ds
  End If
End If
Wim

From: Alphen aan den Rijn, Netherlands
Posts: 23
Member Since: 06/22/05
posted September 29, 2008 5:04 AM

Hallo Ken,

Thanks for the example, it makes things much easier!
Wim

From: Alphen aan den Rijn, Netherlands
Posts: 23
Member Since: 06/22/05
posted February 20, 2009 11:39 AM

Hi,

This has been working well for some time now. Is it allowed to pass pure binary data (so it can contain '00' and other control characters)?
Jason Farrar (Admin)

From: Oneida, NY USA
Posts: 223
Member Since: 07/24/07

Extra Support Options
Custom Application Development

posted February 23, 2009 10:12 AM

YEs it should transfer binary files with no problem.
Reply | PowerTCP Server for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX