Platforms to show: All Mac Windows Linux Cross-Platform

/CURL/CURL query file size
Feedback.

Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /CURL/CURL query file size
This example is the version from Thu, 6th Jan 2010.
Notes: Last modified: Thu, 6th Jan 2010
Class Window1
Inherits Window
// Controls
ControlInstance
Sub Action() Handles Event
DoDownload
End Sub
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
End ControlInstance

// Methods
Private Sub DoDownload()

dim e as integer
dim d as DownloadCURL

d=new DownloadCURL
d.OptionNoBody=true
d.OptionURL=url.text
e=d.Perform

ResultText.text="Result: "+str(e)

MsgBox str(d.FileSize)

End Sub
End Class

Class App
Inherits Application
End Class

Class DownloadCURL
Inherits Object
// Properties
Dim FileSize As Double

// Event implementations
Function Write(data as string) As integer

Return lenb(Data)
End Function
Function Header(data as string) As integer
if left(data,16)="Content-Length: " then
FileSize = val(mid(data,17))
end if

Return lenb(data)

End Function
End Class


See also:




Links
MBS Realbasic Plugins - Pfarrgemeinde Ministranten Nickenich