Menu

How can I get the received file name?

Help
xu long
2008-03-04
2013-04-25
  • xu long

    xu long - 2008-03-04

    hello:

       I use lightblue to receive files by bluetooth,but I can't get the file name and extension.And I use "hcidump -X -V" to monitor the data stream,I find the filename and extension are included in the first package,but I don't know how to get it out? I think it's convenient if we can get the filename by this method.

        the example in lightblue:

        # receive a file and save it as MyFile.txt
        >>> s = lightblue.socket()
        >>> s.bind(("", 0))
        >>> lightblue.advertise("My OBEX Service", s, lightblue.OBEX)
        >>> lightblue.obex.recvfile(s, "MyFile.txt")  # or pass file object instead
        >>> s.close()

        maybe it's not a .txt file :)

        with hcidump -X -V
        we can see name\ length \type \time \body items of a file.

        how to get it in bluelight?

        Maybe it's a convenient and useful function for the better use of lightblue! :D
       
        thank you for your great work!

     
    • blam

      blam - 2008-03-04

      Hi,

      I've posted a solution in this thread:
      https://sourceforge.net/forum/message.php?msg_id=4814640

      It's definitely something I want to add in a later release.

       
    • loren

      loren - 2008-03-08

      Great!

      Now I distinguish with first line contents in the received data,of course it's not reliable.

      Get the file name automatically will be great help!

      Thank you for you reply!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.