File Transfer Question

Is there a way to tell what type of file is being transfered before the transfer is accepted. I am wanting to detect certain file types and auto accept them under certain criterion, but I have not found a way to look inside a file before the transfer is accepted. Any help would be greatly appreciated.

Thnx,

E

The best you can do is look inside the FileTransferRequest instance that you receive in your registered FileTransferListener. I have a similar need to auto accept certain files. What I do is put a known value in the description field of the FileTransferRequest and check for that value on the receiving side. You can also get the mime type, file name, and size from the request. So you could base your auto-acceptance on the mime type value.

Pony

The mime-type set on the the request is the type of the file about to be sent. This is set, in Smack at least, by examining the file extension.

Thanks,

Alex

Alex’'s answer is correct.

thanks,

E

Message was edited by: the.eagle

Hi,

if Alex’'s answer is really right one (you) might use the “Mark Answer” button so everyone just need to look for the green star to see the right answer.

LG