Hello
Is it possible to determine what type of data has been downloaded by httpjob?
For example, the following code will successfully download whatever 'somefile' is however it will error if it isn't a bitmap:
Is there a test that can be carried out on the downloaded data to see what the data is before processing it further?
E.g. Something along the lines of:
If j.DataType = "PNG" then Log("PNG file download")
If j.DataType = "text" then Log("Text file downloaded")
Or if the downloaded data were written to a file, is there something that can say if the file is text, jpeg, PNG, zip, etc. (obviously without relying on the file extension)?
Regards
Joe
Is it possible to determine what type of data has been downloaded by httpjob?
For example, the following code will successfully download whatever 'somefile' is however it will error if it isn't a bitmap:
Download bitmap:
Dim myBMP as Bitmap
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://somewhere/somefile")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then myBMP = j.GetBitmap
Is there a test that can be carried out on the downloaded data to see what the data is before processing it further?
E.g. Something along the lines of:
If j.DataType = "PNG" then Log("PNG file download")
If j.DataType = "text" then Log("Text file downloaded")
Or if the downloaded data were written to a file, is there something that can say if the file is text, jpeg, PNG, zip, etc. (obviously without relying on the file extension)?
Regards
Joe