Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Convert application/octet-stream file to text/plain
Forum Updated to NodeBB v4.3 + New Features

Convert application/octet-stream file to text/plain

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 22.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aysenur
    wrote on 22 Aug 2017, 12:37 last edited by
    #1

    Hello,
    I want to convert application/octet-stream file to text/plain.There are many web sites which can convert files into different formats on the web. Also I can convert my file through a web application but I want to do it in QT. There is a QMimeType and QMimeDatabase libraries and by the help of the libraries I can learn type of my file. But how to convert ? Thank you in advance.

    R 1 Reply Last reply 22 Aug 2017, 12:39
    0
    • A aysenur
      22 Aug 2017, 12:37

      Hello,
      I want to convert application/octet-stream file to text/plain.There are many web sites which can convert files into different formats on the web. Also I can convert my file through a web application but I want to do it in QT. There is a QMimeType and QMimeDatabase libraries and by the help of the libraries I can learn type of my file. But how to convert ? Thank you in advance.

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 22 Aug 2017, 12:39 last edited by
      #2

      @aysenur
      At least to me, it's completely unclear what you are trying to do.
      The mime-type application/octet-stream is actually applicable for any file type since it only represents a binary data stream. So you can convert it to any file type actually. So what are you trying to to do?!

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 22 Aug 2017, 12:40 last edited by
        #3

        Hi,

        What conversions do you have in mind ? There's no magic wand transforming the PowerPoint document you download into a video file.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply 22 Aug 2017, 13:41
        1
        • S SGaist
          22 Aug 2017, 12:40

          Hi,

          What conversions do you have in mind ? There's no magic wand transforming the PowerPoint document you download into a video file.

          A Offline
          A Offline
          aysenur
          wrote on 22 Aug 2017, 13:41 last edited by
          #4

          I want to convert my binary stl file to Ascii stl file(which is in plan/text format) to read it from qt and display on the screen. When I checked the properties of the files, which qt code reads, are ascii stl files but the stl files which are scanned from our 3d scanner is in application/octet-stream. I thought that when I change the mimetype of the file I can convert but this is wrong. I need to do more I think. Thank you.

          R 1 Reply Last reply 22 Aug 2017, 13:51
          0
          • A aysenur
            22 Aug 2017, 13:41

            I want to convert my binary stl file to Ascii stl file(which is in plan/text format) to read it from qt and display on the screen. When I checked the properties of the files, which qt code reads, are ascii stl files but the stl files which are scanned from our 3d scanner is in application/octet-stream. I thought that when I change the mimetype of the file I can convert but this is wrong. I need to do more I think. Thank you.

            R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 22 Aug 2017, 13:51 last edited by raven-worx
            #5

            @aysenur
            so you are getting application/octet-stream from querying QMimeDatabase? If so this just means that there couldn't be a related mime-type found.

            So you want to convert a binary STL file to a ASCII-STL file and also render it's 3D model? Well this requires that you fully understand the binary structure of binary STL files in order to do the proper conversation and the proper interpretation.

            You are better off searching for a C/C++ library which does the work for you. Alternatively you may want to use a webservice to do so in your application.

            But i think i am not going too far when i say that doing this all on your own is illusionary, when you already asked this question.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            A 1 Reply Last reply 22 Aug 2017, 13:59
            1
            • R raven-worx
              22 Aug 2017, 13:51

              @aysenur
              so you are getting application/octet-stream from querying QMimeDatabase? If so this just means that there couldn't be a related mime-type found.

              So you want to convert a binary STL file to a ASCII-STL file and also render it's 3D model? Well this requires that you fully understand the binary structure of binary STL files in order to do the proper conversation and the proper interpretation.

              You are better off searching for a C/C++ library which does the work for you. Alternatively you may want to use a webservice to do so in your application.

              But i think i am not going too far when i say that doing this all on your own is illusionary, when you already asked this question.

              A Offline
              A Offline
              aysenur
              wrote on 22 Aug 2017, 13:59 last edited by
              #6

              @raven-worx Thank you for your reply. There are codes for reading stl files on github. I am not doing all staff by myself. But the files should be in plain/text format. Because when I open the stl file which is in octet stream has mixed characters. In the code for reading the triangle positions there are some beginnings and endings but in binary format there is not. Your web service offer is good I will search it and I will search for c++ .

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Pablo J. Rogina
                wrote on 22 Aug 2017, 19:43 last edited by
                #7

                @aysenur Have you read any documentation about the binary and ASCII formats for STL files? i.e. this wikipedia entry may help.

                And this Ruby program may help as well in the conversion process itself, being that you run the script as an external process with QProcess, or by reading the Ruby code and writing the equivalent corresponding C++ code (at least initially you'll only needs just one part, binary to ASCII)

                Upvote the answer(s) that helped you solve the issue
                Use "Topic Tools" button to mark your post as Solved
                Add screenshots via postimage.org
                Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                A 1 Reply Last reply 23 Aug 2017, 12:10
                0
                • P Pablo J. Rogina
                  22 Aug 2017, 19:43

                  @aysenur Have you read any documentation about the binary and ASCII formats for STL files? i.e. this wikipedia entry may help.

                  And this Ruby program may help as well in the conversion process itself, being that you run the script as an external process with QProcess, or by reading the Ruby code and writing the equivalent corresponding C++ code (at least initially you'll only needs just one part, binary to ASCII)

                  A Offline
                  A Offline
                  aysenur
                  wrote on 23 Aug 2017, 12:10 last edited by
                  #8

                  @Pablo-J.-Rogina Thank you. I will check ruby program.

                  1 Reply Last reply
                  0

                  1/8

                  22 Aug 2017, 12:37

                  • Login

                  • Login or register to search.
                  1 out of 8
                  • First post
                    1/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved